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 |
|---|---|---|---|---|---|
63,324,647 | I am plotting countries on map using plotly and r shiny. I would like subset of data containing rows about the country to appear in the form of data table on clicking on country on a map. But I am unable to implement it. I get the table but there is not data displayed in the table. Any help would be appreciated!
```
M... | 2020/08/09 | [
"https://Stackoverflow.com/questions/63324647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13017372/"
] | Try running the command `flutter pub get -v`.
It shows the log and can even solve the problem. | Run the following command:
```
flutter pub global activate devtools
```
Then try to get the packages again.
I hope this helps fix the issue |
974,835 | ```
=IF(ISBLANK(CM7),"",IF(CN7=F7>1,-1, IF(CN7=F7>-1,1, IF(CN7=F7,0))))
```
What I want to say is that if cell `CM7` is blank, then leave the cell where the calculation takes place blank. Otherwise, if `CN7 > F7`, enter `1`. If `CN7 = F7` type `0`. If `CN7 < F7` enter `-1`
Whatever I enter in `CM7` at present, it ... | 2015/09/18 | [
"https://superuser.com/questions/974835",
"https://superuser.com",
"https://superuser.com/users/498912/"
] | Since you're using EFI with an encrypted /boot, I'm assuming you're already familiar with `grub-mkstandalone`
Add in `/etc/default/grub` :
```
GRUB_TERMINAL_INPUT=at_keyboard
```
Add in `/etc/grub.d/40_custom` :
```
insmod keylayouts
keymap /boot/grub/de.gkb
```
Next run `grub-kbdcomp -o /tmp/de.gkb de` to gener... | It cannot be done, see [this Introduction to Grub2](https://www.suse.com/documentation/opensuse113/book_opensuse_reference/data/sec_grub_basic.html) which states explicitly:
>
> Important: Keyboard Layout during the Boot Procedure
>
>
> The US keyboard layout is the only one available when booting
>
>
> |
3,106,234 | WTS: For two metric spaces $X,Y$ If $f:X \rightarrow Y$ is continuous then for every open set $U\subset Y$, $f^{-1}(U)$ is open.
May someone please verify if this proof is correct?
>
> Proof: Assume $f$ is continuous. Let $U$ be an open set in $Y$. Let
> $x\in f^{-1}(U)$. Since $U$ is open, there exists an $\epsilon... | 2019/02/09 | [
"https://math.stackexchange.com/questions/3106234",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | The procedure is exactly the same as for square matrices. I'll do a simpler example for the nullspace, see if you can apply the idea to your case. Let's try to find the nullspace for
$$ A=\begin{bmatrix}1&2&3&4\\1&1&1&4\\0&1&2&3\end{bmatrix}. $$
Do Gaussian Elimination to find the reduced row echelon form, $\operatorna... | The null space is the set of vectors $v$, such that $f\_A(v) = 0$. This means that you need to solve $Av = [0, 0, 0, 0]^T$. This amounts to Gaussian elimination. In this case, the echelon form of A is
$$
A=\left(\begin{array}{rrrrr}
1 & 0 & -1 & 0 & 2 \\
0 & 1 & 4 & 0 & -3 \\
0 & 0 & 0 & 1 & 1 \\
0 & 0 & 0 & 0 & 0
\end... |
64,323,360 | I am trying to create Azure AD provisioning for our Saas product (using scim2).
I want multiple customers to be able to connect with their Azure AD tenant.
Microsoft has reference code here: <https://github.com/AzureAD/SCIMReferenceCode>
However, that is setup to only allow one tenant and also to not use the "secret ... | 2020/10/12 | [
"https://Stackoverflow.com/questions/64323360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/700320/"
] | So I figured out that what they want is a JWT token in that field that I generate.
So first I created a method that generates a web token
```
private string GenerateJSONWebToken()
{
// Create token key
SymmetricSecurityKey securityKey =
new SymmetricSecurityKey(Encoding.UTF8.GetBytes(c... | You can visit [Managing user account provisioning for enterprise apps in the Azure portal](https://learn.microsoft.com/en-us/azure/active-directory/app-provisioning/configure-automatic-user-provisioning-portal#finding-your-apps-in-the-portal) know more about the setup:
[;
```
I'm reading bytes from a binary file, storing them into a char array, and then I'm trying to print out an int value based on an offset value. | 2015/04/29 | [
"https://Stackoverflow.com/questions/29933208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3370603/"
] | The following converts a 4 byte array (4 chars) into a 32-bit unsigned integer.
You should be able to easily extend this to 8 chars (i.e., 64-bit unsigned int).
Iterate array backwards (can do forwards as well) and shift the int representation of the respective character accordingly and fit it into the resultant value... | I generally thought you have to store as a char first, then you cast to int during the println(). |
29,933,208 | Say you have an char array, which holds 8 bytes. How would you convert that char array into an integer?
I tried using sscanf -
```
int x;
sscanf(char_array, "%d", &x);
```
I'm reading bytes from a binary file, storing them into a char array, and then I'm trying to print out an int value based on an offset value. | 2015/04/29 | [
"https://Stackoverflow.com/questions/29933208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3370603/"
] | I think you just want to read hexadecimal numbers which are usually 8 bytes in text form. You can use this:
```
sscanf(char_array, "%x", &x);
```
If it's really binary, it would be 4 bytes each and it depends if the machine is little-endian or big-endian. Most computers are little-endian. To make a portable version,... | I generally thought you have to store as a char first, then you cast to int during the println(). |
29,933,208 | Say you have an char array, which holds 8 bytes. How would you convert that char array into an integer?
I tried using sscanf -
```
int x;
sscanf(char_array, "%d", &x);
```
I'm reading bytes from a binary file, storing them into a char array, and then I'm trying to print out an int value based on an offset value. | 2015/04/29 | [
"https://Stackoverflow.com/questions/29933208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3370603/"
] | The following converts a 4 byte array (4 chars) into a 32-bit unsigned integer.
You should be able to easily extend this to 8 chars (i.e., 64-bit unsigned int).
Iterate array backwards (can do forwards as well) and shift the int representation of the respective character accordingly and fit it into the resultant value... | Is it really char array and not unicode where 2 bytes represent one character?
Are you sure result will fit into int?
If so, then here is simple solution:
```
int x=0;
for (int i=0; i<8; i++) x=x*10 + char_array[i]-'0';
``` |
29,933,208 | Say you have an char array, which holds 8 bytes. How would you convert that char array into an integer?
I tried using sscanf -
```
int x;
sscanf(char_array, "%d", &x);
```
I'm reading bytes from a binary file, storing them into a char array, and then I'm trying to print out an int value based on an offset value. | 2015/04/29 | [
"https://Stackoverflow.com/questions/29933208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3370603/"
] | I think you just want to read hexadecimal numbers which are usually 8 bytes in text form. You can use this:
```
sscanf(char_array, "%x", &x);
```
If it's really binary, it would be 4 bytes each and it depends if the machine is little-endian or big-endian. Most computers are little-endian. To make a portable version,... | If you are reading bytes from a binary file, I suggest to read directly from the file to the integer variable. As followed:
```
#include <stdio.h>
int main() {
FILE *file = fopen("myFile", "r");
int i;
if (file) {
fread(&i, sizeof(i), 1, file);
printf("%d\n", i);
... |
29,933,208 | Say you have an char array, which holds 8 bytes. How would you convert that char array into an integer?
I tried using sscanf -
```
int x;
sscanf(char_array, "%d", &x);
```
I'm reading bytes from a binary file, storing them into a char array, and then I'm trying to print out an int value based on an offset value. | 2015/04/29 | [
"https://Stackoverflow.com/questions/29933208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3370603/"
] | I think you just want to read hexadecimal numbers which are usually 8 bytes in text form. You can use this:
```
sscanf(char_array, "%x", &x);
```
If it's really binary, it would be 4 bytes each and it depends if the machine is little-endian or big-endian. Most computers are little-endian. To make a portable version,... | Is it really char array and not unicode where 2 bytes represent one character?
Are you sure result will fit into int?
If so, then here is simple solution:
```
int x=0;
for (int i=0; i<8; i++) x=x*10 + char_array[i]-'0';
``` |
29,933,208 | Say you have an char array, which holds 8 bytes. How would you convert that char array into an integer?
I tried using sscanf -
```
int x;
sscanf(char_array, "%d", &x);
```
I'm reading bytes from a binary file, storing them into a char array, and then I'm trying to print out an int value based on an offset value. | 2015/04/29 | [
"https://Stackoverflow.com/questions/29933208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3370603/"
] | Is it really char array and not unicode where 2 bytes represent one character?
Are you sure result will fit into int?
If so, then here is simple solution:
```
int x=0;
for (int i=0; i<8; i++) x=x*10 + char_array[i]-'0';
``` | I generally thought you have to store as a char first, then you cast to int during the println(). |
29,933,208 | Say you have an char array, which holds 8 bytes. How would you convert that char array into an integer?
I tried using sscanf -
```
int x;
sscanf(char_array, "%d", &x);
```
I'm reading bytes from a binary file, storing them into a char array, and then I'm trying to print out an int value based on an offset value. | 2015/04/29 | [
"https://Stackoverflow.com/questions/29933208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3370603/"
] | Combining 8 char into an integer would result in a 64-bit integer, so you may need to declare it as `unsigned long long int`...
```
#include <stdio.h>
void showBinary(unsigned long long x) {
int i;
for(i = 63; i >= 0; i--)
printf("%d", x & (1ULL << i) ? 1 : 0);
printf("\n");
}
int main(void) {
... | Is it really char array and not unicode where 2 bytes represent one character?
Are you sure result will fit into int?
If so, then here is simple solution:
```
int x=0;
for (int i=0; i<8; i++) x=x*10 + char_array[i]-'0';
``` |
29,933,208 | Say you have an char array, which holds 8 bytes. How would you convert that char array into an integer?
I tried using sscanf -
```
int x;
sscanf(char_array, "%d", &x);
```
I'm reading bytes from a binary file, storing them into a char array, and then I'm trying to print out an int value based on an offset value. | 2015/04/29 | [
"https://Stackoverflow.com/questions/29933208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3370603/"
] | Combining 8 char into an integer would result in a 64-bit integer, so you may need to declare it as `unsigned long long int`...
```
#include <stdio.h>
void showBinary(unsigned long long x) {
int i;
for(i = 63; i >= 0; i--)
printf("%d", x & (1ULL << i) ? 1 : 0);
printf("\n");
}
int main(void) {
... | I generally thought you have to store as a char first, then you cast to int during the println(). |
29,933,208 | Say you have an char array, which holds 8 bytes. How would you convert that char array into an integer?
I tried using sscanf -
```
int x;
sscanf(char_array, "%d", &x);
```
I'm reading bytes from a binary file, storing them into a char array, and then I'm trying to print out an int value based on an offset value. | 2015/04/29 | [
"https://Stackoverflow.com/questions/29933208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3370603/"
] | The following converts a 4 byte array (4 chars) into a 32-bit unsigned integer.
You should be able to easily extend this to 8 chars (i.e., 64-bit unsigned int).
Iterate array backwards (can do forwards as well) and shift the int representation of the respective character accordingly and fit it into the resultant value... | If you are reading bytes from a binary file, I suggest to read directly from the file to the integer variable. As followed:
```
#include <stdio.h>
int main() {
FILE *file = fopen("myFile", "r");
int i;
if (file) {
fread(&i, sizeof(i), 1, file);
printf("%d\n", i);
... |
29,933,208 | Say you have an char array, which holds 8 bytes. How would you convert that char array into an integer?
I tried using sscanf -
```
int x;
sscanf(char_array, "%d", &x);
```
I'm reading bytes from a binary file, storing them into a char array, and then I'm trying to print out an int value based on an offset value. | 2015/04/29 | [
"https://Stackoverflow.com/questions/29933208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3370603/"
] | If you are reading bytes from a binary file, I suggest to read directly from the file to the integer variable. As followed:
```
#include <stdio.h>
int main() {
FILE *file = fopen("myFile", "r");
int i;
if (file) {
fread(&i, sizeof(i), 1, file);
printf("%d\n", i);
... | I generally thought you have to store as a char first, then you cast to int during the println(). |
56,380,055 | I've got 2 columns in a table, Financial\_Year and Financial\_Quarter. An example of the data is as follows:
```
Financial_Year Financial_Quarter
2018/2019 2
```
I want to produce a third column called 'Year\_month' which is the last month of the quarter within each financial year, so in the above example I... | 2019/05/30 | [
"https://Stackoverflow.com/questions/56380055",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8461548/"
] | Assuming the FINANCIAL\_YEAR column is a string (two numbers separated by slash) and the financial year 2018/2019 begins on 1 April 2018 and ends on 31 March 2019, you could do something like this:
```
with
test_data (financial_year, financial_quarter) as (
select '2018/2019', 1 from dual union all
select '2... | I guess there are many ways to skin this cat, here is one
```
SELECT CASE WHEN financial_quarter = '4' THEN SUBSTR(financial_year, 6, 4) || '03'
ELSE SUBSTR(financial_year, 1, 4) || LPAD((financial_quarter + 1) * 3, 2, '0')
END
FROM some_table
```
Of course '4' needs to be replaced with 4 if `financia... |
25,357,181 | I have a program which computes perimeter, circumference, an area of different shapes like, square, circle, rectangle and soon. Any help with enabling the radiobutton to display an edittext to write the measurements. | 2014/08/18 | [
"https://Stackoverflow.com/questions/25357181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3888060/"
] | check below code don't use as it is, its just reference
inyourxml.xml
```
<RadioGroup
android:id="@+id/groupRadio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/app_big_margin"
android:layout_marginRight="@dimen/app_normal_margin"
a... | [Hide a EditText & make it visible by clicking a menu](https://stackoverflow.com/questions/4622517/hide-a-edittext-make-it-visible-by-clicking-a-menu)
in case of menu ... you can declare setvisibility in xml and make it hide... then programatically make it visible...hope this helps |
6,802,112 | I run out of memory while finding the 10,001th prime number.
```
object Euler0007 {
def from(n: Int): Stream[Int] = n #:: from(n + 1)
def sieve(s: Stream[Int]): Stream[Int] = s.head #:: sieve(s.filter(_ % s.head != 0))
def primes = sieve(from(2))
def main(args: Array[String]): Unit = {
println(primes(10001... | 2011/07/23 | [
"https://Stackoverflow.com/questions/6802112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383124/"
] | One reason why this is slow is that it **isn't** the sieve of Eratosthenes. Read <http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf> for a detailled explanation (the examples are in Haskell, but can be translated directly into Scala).
My old solution for Euler problem #7 wasn't the "true" sieve either, but it seems t... | FWIW, here's a real Sieve of Eratosthenes:
```
def sieve(n: Int) = (2 to math.sqrt(n).toInt).foldLeft((2 to n).toSet) { (ps, x) =>
if (ps(x)) ps -- (x * x to n by x)
else ps
}
```
Here's an infinite stream of primes using a variation on the Sieve of Eratosthenes that preserves its fundamental properties:
... |
6,802,112 | I run out of memory while finding the 10,001th prime number.
```
object Euler0007 {
def from(n: Int): Stream[Int] = n #:: from(n + 1)
def sieve(s: Stream[Int]): Stream[Int] = s.head #:: sieve(s.filter(_ % s.head != 0))
def primes = sieve(from(2))
def main(args: Array[String]): Unit = {
println(primes(10001... | 2011/07/23 | [
"https://Stackoverflow.com/questions/6802112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/383124/"
] | One reason why this is slow is that it **isn't** the sieve of Eratosthenes. Read <http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf> for a detailled explanation (the examples are in Haskell, but can be translated directly into Scala).
My old solution for Euler problem #7 wasn't the "true" sieve either, but it seems t... | ***Yes, it is*** because you "increase the stack of functions to be called to get the next element, by one after *each "iteration"* " - i.e. add a new filter on top of stack of filters each time after getting each prime. That's **way too many filters**.
This means that each produced prime gets tested by all its preced... |
73,208,689 | When running the flutter build apk command, I am getting the following error:
Pubspec.yaml
[](https://i.stack.imgur.com/8MkAR.png)
Error code:
[](https://i.stack.imgur.com/Ku70u.png) | 2022/08/02 | [
"https://Stackoverflow.com/questions/73208689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18796940/"
] | Open your `pubspec.yaml`
search for this:
[](https://i.stack.imgur.com/7QHaG.png)
Then change the SDK to: `">=2.17.5 <3.0.0"` | You can write
`flutter upgrade`
command in terminal to update flutter sdk |
35,763,305 | How can I make my `$superhero_list` array updates after all the code on the superhero.php is done and I want to search for another name?
The problem I find is that after Im done with the superhero.php and go back to superhero.html, it doesnt save the last name on the `$superhero_list` array.
**superhero.html**
```
... | 2016/03/03 | [
"https://Stackoverflow.com/questions/35763305",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6011209/"
] | If you dont want to store in database then you need to store array value in cookie.
<http://php.net/manual/en/features.cookies.php>
For cookie you can store value until your browser will not close. | To my understanding you want to:
* If the hero exists, echo the information about the hero.
* If the hero does not exist, add them to the array.
And you want to be able to keep track of every single hero that is added to the array, even after the user navigates away and back again.
---
When you navigate away from t... |
35,763,305 | How can I make my `$superhero_list` array updates after all the code on the superhero.php is done and I want to search for another name?
The problem I find is that after Im done with the superhero.php and go back to superhero.html, it doesnt save the last name on the `$superhero_list` array.
**superhero.html**
```
... | 2016/03/03 | [
"https://Stackoverflow.com/questions/35763305",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6011209/"
] | You are resetting the array every time you run the PHP script. You need to save the data so that next time it runs it can pull the data back.
You can either do this by building a database to hold all the names, or you can save them to a file. With something this small saving it to a file is probably the easiest and qui... | To my understanding you want to:
* If the hero exists, echo the information about the hero.
* If the hero does not exist, add them to the array.
And you want to be able to keep track of every single hero that is added to the array, even after the user navigates away and back again.
---
When you navigate away from t... |
42,270,896 | in my Robot framework tests I need some custom python keywords (e.g. to hold CTRL key)
And everything worked before I started refactoring my "big" custom class (but I did not really change anything in this part around hold CTRL).
Now I am getting `AttributeError: 'Selenium2Library' object has no attribute 'execute'` ... | 2017/02/16 | [
"https://Stackoverflow.com/questions/42270896",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5313317/"
] | The problem was in ActionChains, because it needs webdriver instance, not Se2Lib instance. Webdriver instance can be obtained by calling \_current\_browser(). I reworked it this way and it works:
```
def get_library_instance(self):
if self.library is None:
self.library = BuiltIn().get_library_instance('Sel... | What about something like this:
```
class CustomSeleniumLibrary(Selenium2Library):
def __init__(self):
super(CustomSeleniumLibrary, self).__init__()
def _parent(self):
return super(CustomSeleniumLibrary, self)
def hold_ctrl(self):
ActionChains(self._current_browser()).send_keys(Ke... |
13,784,752 | I have a [news site](http://www.vincenttimes.com/living/healthy-living/2012/12/08/12373/e-cigarettes-are-they-harmful-to-our-health/) and have a 300x600 banner in the middle of every post on the left side.
I want to move the banner 150px outside the 960px wide "page", so the banner is half in and half out.The only way... | 2012/12/09 | [
"https://Stackoverflow.com/questions/13784752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1699495/"
] | Yes, `position:absolute` doesn't wrap text because you are removing the element from the flow of the [document](http://www.w3.org/wiki/CSS_absolute_and_fixed_positioning).
You can margin it out by 150px using `margin-left:-150px` however, your css for the class `.entry` has `overflow:hidden` which will have to be rem... | Try with the property `margin-left:-150px;` |
28,103,386 | I trying to post form in yii but don't have any idea regarding validation, i go through some yii documentation but not getting it. can't we do validation without form object of yii? means in view i am using normal HTML for form of yii. | 2015/01/23 | [
"https://Stackoverflow.com/questions/28103386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4168892/"
] | Simulink/Stateflow prefer numeric data. You should use an integer representation of the ASCII value (using a uint8 or uint16 data type), which will make comparison almost trivial. | Matlab does not make a clear distinction between a string with just one char and a char, and as far as I know, it is not possible to use a string type in stateflow.
Convert the input to integers then use only comparisons of integers inside the state chart.
You can use this function to convert chars to integers in Matla... |
24,708 | Is there a difference here:
>
> 1. ***It happened that*** he did not go to work today.
> 2. ***As it happened***, he did not go to work today.
>
>
>
Do "it happened that" and "as it happened" have different meanings? | 2014/06/03 | [
"https://ell.stackexchange.com/questions/24708",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/6362/"
] | As stated in the definition, it means *to be in a specified circumstance*; in this case, *he* is in the circumstance of *probably losing ten dollars*. The use of *stand* here means that the loss of money has not occurred yet and is not assured, but is likely to happen, and soon.
It's quite possible that he placed a $1... | In its fuller form, it could be said that "he stands **the chance of losing** ten dollars." In most cases it would be assumed that it's the result of a bet that he placed, unless there was contextual information indicating otherwise. |
24,708 | Is there a difference here:
>
> 1. ***It happened that*** he did not go to work today.
> 2. ***As it happened***, he did not go to work today.
>
>
>
Do "it happened that" and "as it happened" have different meanings? | 2014/06/03 | [
"https://ell.stackexchange.com/questions/24708",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/6362/"
] | There's no "special reason", other than that's the way the phrase can be used.
Incidentally, you can *stand to lose* things other than money:
>
> Mr Forrest [stands to lose](http://www.theaustralian.com.au/archive/news/top-silk-thwarted-in-cattle-showdown/story-e6frg6no-1225704498337) his right to serve as a company... | In its fuller form, it could be said that "he stands **the chance of losing** ten dollars." In most cases it would be assumed that it's the result of a bet that he placed, unless there was contextual information indicating otherwise. |
56,406,188 | I am new in the **tidyverse** data manipulation and I am using `gather()` function from the `tidyr` package for changing from wide to long form on my data.
I have the following `data` dataframe:
```
id <- 1:10
stim_1_ACC <- 0.5:10
stim_2_ACC <- 10:19
stim_1_RT <- 0.4:10
stim_2_RT <- 15:24
data <- data.frame(id,stim... | 2019/06/01 | [
"https://Stackoverflow.com/questions/56406188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9032257/"
] | Probably , after gathering you'll need to use `extract`/`separate` to separate `"stim.."` and `"RT"/"ACC"` component and then use `spread`
```
library(dplyr)
library(tidyr)
data %>%
gather(key, value, -id) %>%
extract(key, into = c("stim", "temp"), regex = "(stim_\\d+)_(.*)") %>%
spread(temp, value)
``` | Here is an option with `separate` to split the 'key' column into 'stim' and 'temp' by splitting at the '\_' before the character element
```
library(tidyverse)
data %>%
gather(key, value, -id) %>%
separate(key, into = c("stim", "temp"), sep="(_)(?=[A-Z])") %>%
spread(temp, value)
``` |
21,810,112 | ```
while(cout << "How many elements do you want: " && !(cin >> el))
{
cin.sync();
cin.clear();
cout << " Invalid input!\n";
}
```
el is an int, when I typed a character, the loop goes infinite.
I followed one of the posts in SO to fix bad input, but it is n... | 2014/02/16 | [
"https://Stackoverflow.com/questions/21810112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2720065/"
] | When an error occurs when reading from a stream, an error flag gets set and no more reading is possible until you clear the error flags.
>
> That's why you get an infinite loop.
>
>
>
Instead use :
```
cin.clear(); // clears the error flags
// this line discards all the input waiting in the stream
cin.ignor... | Perform `cin.clear()` before `cin.sync()`. It works for me. |
4,534,370 | The time I used to develop applications on iPhone I was converting String to SHA1 with two combination:
* Data
* Key
Now I am developing an Android application and I did not any example for how to calculate SHA1 With key.
I am greatly appreciative of any guidance or help.
---
*[The code that I currently use]*
```... | 2010/12/26 | [
"https://Stackoverflow.com/questions/4534370",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/488434/"
] | Try something like that:
```
private String sha1(String s, String keyString) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException {
SecretKeySpec key = new SecretKeySpec((keyString).getBytes("UTF-8"), "HmacSHA1");
Mac mac = Mac.getInstance("HmacSHA1");
mac.init(key);
byte[] bytes = mac.... | Another solution would be using apache commons codec library:
```
@Grapes(
@Grab(group='commons-codec', module='commons-codec', version='1.10')
)
import org.apache.commons.codec.digest.HmacUtils
HmacUtils.hmacSha1Hex(key.bytes, message.bytes)
``` |
27,878,068 | I have this table in my database:
```
GroupStandings
+--------+----------+--------------+--------+
| TeamID | GoalsFor | GoalsAgainst | Points |
+--------+----------+--------------+--------+
| 1 | 0 | 0 | 0 |
| 2 | 0 | 0 | 0 |
| 3 | 0 | 0 |... | 2015/01/10 | [
"https://Stackoverflow.com/questions/27878068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4269298/"
] | There are many issues with your code, but the key one for the purposes of your bug is that each time through the loop you assign to `nw`, overwriting all previous assignments to it. So, of course, only the **last** assignment matters!
Just fixing that will only keep exposing further and further layers of bugs -- it's ... | ```
ejmin = "ej pj dj"
a=ejmin.split() #split it by space
for x in a:
t=x[1:] #slicing it from first character to end of word
print (t)
```
Output:
```
>>>
j
j
j
>>>
```
Splitting them by space character, and slicing from first character.
Edit:
```
ejmin = "ej pj dj"
a=ejmin.split()
for x in a:
z=... |
27,878,068 | I have this table in my database:
```
GroupStandings
+--------+----------+--------------+--------+
| TeamID | GoalsFor | GoalsAgainst | Points |
+--------+----------+--------------+--------+
| 1 | 0 | 0 | 0 |
| 2 | 0 | 0 | 0 |
| 3 | 0 | 0 |... | 2015/01/10 | [
"https://Stackoverflow.com/questions/27878068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4269298/"
] | There are many issues with your code, but the key one for the purposes of your bug is that each time through the loop you assign to `nw`, overwriting all previous assignments to it. So, of course, only the **last** assignment matters!
Just fixing that will only keep exposing further and further layers of bugs -- it's ... | >
> I tried it by slicing
>
>
>
```
ejmin = "ej pj dj"
for word in ejmin.split():
print word[1:],
``` |
43,862,031 | 'OutOfMemoryError':
Usually, this error is thrown when there is insufficient space to allocate an object in the Java heap.
GC (Allocation Failure):
Allocation Failure” means that there is an allocation request that is bigger than the available space in young generation.
Does this mean Allocation Failure will be throw... | 2017/05/09 | [
"https://Stackoverflow.com/questions/43862031",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3024119/"
] | These *could* become related as far as I can tell; but they are entirely different things.
`OutOfMemory` is an error you can not recover from - the JVM will die at this point.
`GC (Allocation Failure): Allocation Failure` is the reason why GC will kick in (and do a minor collection). At this point some things might ... | In general, an `OutOfMemoryError` occurs when you have exceeded the maximum memory you have already allocated to the JVM. This amount can be changed when starting java using jvm parameters. e.g. `-Xmx2G`. Note that this amount isn't used immediately. See below.
GC (Allocation Failure) is similar, except it occurs when... |
119,905 | Assume that a given postdoctoral position does not require teaching/laboratory.
>
> Are there postdoc positions for someone who wishes to stay in his/her country and just be in touch with the post-doc advisor by e-mail or/and Skype?
>
>
>
Perhaps communicating only by e-mail may be slightly annoying for some peop... | 2018/11/11 | [
"https://academia.stackexchange.com/questions/119905",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/98810/"
] | There is a BIG difference between in-person and via Skype. I have seen this before on several occasions in industry and it simply does not work as well. I doubt it'd be different in academia. It's much harder to integrate a remote worker into a group, especially if they're in a different timezone. I suspect there would... | It is possible for a postdoc to be at a different university from the grant-holder (PI), and supervised virtually as a result. It probably requires an unusual source of funding, and entails either frequent visits or else a co-supervisor/collaborator based at the postdoc's institution.
1. An example
Here is an old [jo... |
119,905 | Assume that a given postdoctoral position does not require teaching/laboratory.
>
> Are there postdoc positions for someone who wishes to stay in his/her country and just be in touch with the post-doc advisor by e-mail or/and Skype?
>
>
>
Perhaps communicating only by e-mail may be slightly annoying for some peop... | 2018/11/11 | [
"https://academia.stackexchange.com/questions/119905",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/98810/"
] | In person and Skype are completely different. Writing math that you can both see becomes a challenge (in person, it's called a blackboard). I get up to fetch a book: communication is lost. Meeting takes longer than expected and it'd be nice to continue talking over lunch? Very difficult with Skype. More than two people... | It is possible for a postdoc to be at a different university from the grant-holder (PI), and supervised virtually as a result. It probably requires an unusual source of funding, and entails either frequent visits or else a co-supervisor/collaborator based at the postdoc's institution.
1. An example
Here is an old [jo... |
119,905 | Assume that a given postdoctoral position does not require teaching/laboratory.
>
> Are there postdoc positions for someone who wishes to stay in his/her country and just be in touch with the post-doc advisor by e-mail or/and Skype?
>
>
>
Perhaps communicating only by e-mail may be slightly annoying for some peop... | 2018/11/11 | [
"https://academia.stackexchange.com/questions/119905",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/98810/"
] | I think that would be entirely up to whoever is funding and or supervising it. I doubt that many would wish to do so as there is little opportunity for direct supervision or keeping track of the activities of the post-doc. It would seem to depend on an inordinate amount of trust.
If you were the funder, you should pr... | It is possible for a postdoc to be at a different university from the grant-holder (PI), and supervised virtually as a result. It probably requires an unusual source of funding, and entails either frequent visits or else a co-supervisor/collaborator based at the postdoc's institution.
1. An example
Here is an old [jo... |
119,905 | Assume that a given postdoctoral position does not require teaching/laboratory.
>
> Are there postdoc positions for someone who wishes to stay in his/her country and just be in touch with the post-doc advisor by e-mail or/and Skype?
>
>
>
Perhaps communicating only by e-mail may be slightly annoying for some peop... | 2018/11/11 | [
"https://academia.stackexchange.com/questions/119905",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/98810/"
] | In person and Skype are completely different. Writing math that you can both see becomes a challenge (in person, it's called a blackboard). I get up to fetch a book: communication is lost. Meeting takes longer than expected and it'd be nice to continue talking over lunch? Very difficult with Skype. More than two people... | A research group or a PI typically wants a researcher who is more committed to the group and to his/her research projects. In-person presence means you are committing your *life* for the duration of the post-doc to that:
* You're moving to a different city or a different country.
* your daily routine will be very dif... |
119,905 | Assume that a given postdoctoral position does not require teaching/laboratory.
>
> Are there postdoc positions for someone who wishes to stay in his/her country and just be in touch with the post-doc advisor by e-mail or/and Skype?
>
>
>
Perhaps communicating only by e-mail may be slightly annoying for some peop... | 2018/11/11 | [
"https://academia.stackexchange.com/questions/119905",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/98810/"
] | I know anecdotal answers aren't always approved of on Stack Exchange, but I do know of post-docs who have arranged to work remotely as standard within the same country (the UK), with occasional physical visits (on average once a week or less) due to independent instances of the two body problem for the PI and the post ... | I'm a postdoc in computer science, working remotely for a UK university, from a different continent.
However, I've been a postdoc for 2 years and it's just the last 3 months of my contract that I've arranged with my supervisor to do remotely, before that I was in the UK.
I'll add my direct experience to the chorus: be... |
119,905 | Assume that a given postdoctoral position does not require teaching/laboratory.
>
> Are there postdoc positions for someone who wishes to stay in his/her country and just be in touch with the post-doc advisor by e-mail or/and Skype?
>
>
>
Perhaps communicating only by e-mail may be slightly annoying for some peop... | 2018/11/11 | [
"https://academia.stackexchange.com/questions/119905",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/98810/"
] | If you are a postdoc for industry, many things are possible. If you are a postdoc in a University or research institution, your institution is subject to rigorous control, which includes financial transparency and visa compliance. Sure, these problems may be solvable for Prof Famous joining the University of Notmuch. B... | It is possible for a postdoc to be at a different university from the grant-holder (PI), and supervised virtually as a result. It probably requires an unusual source of funding, and entails either frequent visits or else a co-supervisor/collaborator based at the postdoc's institution.
1. An example
Here is an old [jo... |
119,905 | Assume that a given postdoctoral position does not require teaching/laboratory.
>
> Are there postdoc positions for someone who wishes to stay in his/her country and just be in touch with the post-doc advisor by e-mail or/and Skype?
>
>
>
Perhaps communicating only by e-mail may be slightly annoying for some peop... | 2018/11/11 | [
"https://academia.stackexchange.com/questions/119905",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/98810/"
] | One thing that hasn't been mentioned in other answers is that the university may have rules that require postdocs to be physically present. Mine does, so this kind of thing would be out of the question. I have no idea how common that is.
I also agree with other answers that say working with an advisor long-distance wo... | It is possible for a postdoc to be at a different university from the grant-holder (PI), and supervised virtually as a result. It probably requires an unusual source of funding, and entails either frequent visits or else a co-supervisor/collaborator based at the postdoc's institution.
1. An example
Here is an old [jo... |
119,905 | Assume that a given postdoctoral position does not require teaching/laboratory.
>
> Are there postdoc positions for someone who wishes to stay in his/her country and just be in touch with the post-doc advisor by e-mail or/and Skype?
>
>
>
Perhaps communicating only by e-mail may be slightly annoying for some peop... | 2018/11/11 | [
"https://academia.stackexchange.com/questions/119905",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/98810/"
] | If you are a postdoc for industry, many things are possible. If you are a postdoc in a University or research institution, your institution is subject to rigorous control, which includes financial transparency and visa compliance. Sure, these problems may be solvable for Prof Famous joining the University of Notmuch. B... | I'm a postdoc in computer science, working remotely for a UK university, from a different continent.
However, I've been a postdoc for 2 years and it's just the last 3 months of my contract that I've arranged with my supervisor to do remotely, before that I was in the UK.
I'll add my direct experience to the chorus: be... |
119,905 | Assume that a given postdoctoral position does not require teaching/laboratory.
>
> Are there postdoc positions for someone who wishes to stay in his/her country and just be in touch with the post-doc advisor by e-mail or/and Skype?
>
>
>
Perhaps communicating only by e-mail may be slightly annoying for some peop... | 2018/11/11 | [
"https://academia.stackexchange.com/questions/119905",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/98810/"
] | In person and Skype are completely different. Writing math that you can both see becomes a challenge (in person, it's called a blackboard). I get up to fetch a book: communication is lost. Meeting takes longer than expected and it'd be nice to continue talking over lunch? Very difficult with Skype. More than two people... | I know anecdotal answers aren't always approved of on Stack Exchange, but I do know of post-docs who have arranged to work remotely as standard within the same country (the UK), with occasional physical visits (on average once a week or less) due to independent instances of the two body problem for the PI and the post ... |
119,905 | Assume that a given postdoctoral position does not require teaching/laboratory.
>
> Are there postdoc positions for someone who wishes to stay in his/her country and just be in touch with the post-doc advisor by e-mail or/and Skype?
>
>
>
Perhaps communicating only by e-mail may be slightly annoying for some peop... | 2018/11/11 | [
"https://academia.stackexchange.com/questions/119905",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/98810/"
] | I know anecdotal answers aren't always approved of on Stack Exchange, but I do know of post-docs who have arranged to work remotely as standard within the same country (the UK), with occasional physical visits (on average once a week or less) due to independent instances of the two body problem for the PI and the post ... | A research group or a PI typically wants a researcher who is more committed to the group and to his/her research projects. In-person presence means you are committing your *life* for the duration of the post-doc to that:
* You're moving to a different city or a different country.
* your daily routine will be very dif... |
57,228 | I recently (about 2 weeks ago) changed from regular road clipless pedals to SPD clipless pedals on my road bike.
I didn't have time to change them myself so I just asked one of the workers to put it on and I know for sure that he didn't apply any grease or oil for where the pedal is inserted and tightened.
Now (after... | 2018/09/22 | [
"https://bicycles.stackexchange.com/questions/57228",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/-1/"
] | Don't ride before servicing thos-e pedals. A poorly greased or loose pedal will ruin the thread of the crank or may even cause breakage of the pedal axle. A correctly tightened but non-greased pedal thread may cause the threads to fuse.
You should remove both pedals, clean the threads and the crank arms, apply grease ... | The shop mechanic may have judged there was already enough grease on the crank threads and more was not required. Only a small amount is sufficient. It will not hurt to check and apply a bit more though. What is more important is tightening the pedals to the correct torque. As mention in other answers loose steel pedal... |
107,126 | In *The Newsroom*, what is meant when Herb counts down to a broadcast by saying "Roll VTRx right before the intro sequence to News Night begins playing? | 2020/03/07 | [
"https://movies.stackexchange.com/questions/107126",
"https://movies.stackexchange.com",
"https://movies.stackexchange.com/users/4083/"
] | >
> Are we supposed to know what happened to his left hand, and what exactly are those tubes in his right arm?
>
>
>
His left hand seems to have been removed by John Doe. Remember that the reason the police are visiting the Sloth victim are because his fingerprints were identified at the Greed murder scene.
The t... | The Sloth death isn't exactly clear...generally we're supposed to assume that deaths to the victims are supposed to be a sort of...'poetic' justice and a part of John Doe's larger spectacle and how each represents their respective sin.
We don't know very much with him, besides he was forced on drugs and rotted away in... |
50,583,347 | I've been trying to import a .class via absolute path while code is running and I don't know how to do it.
I found a way to import a class when it's already in project's build path by `Class.forName();`but I need to find a way to load a class that is not in build path.
The goal is:
1. User is able to upload his own ... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50583347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7111456/"
] | `data.table` approach could be
```r
library(data.table)
name1 <- setdiff(names(setDT(b)), names(setDT(a)))
#perform left outer join and then select required columns
a[b, (name1) := mget(name1), on = .(x > start, x < end)][, .(x, y)]
```
which gives
```
x y
1: 1 a
2: 3 <NA>
3: 5 b
```
**Sample data:*... | You can try a `GenomicRanges` solution
```
library(GenomicRanges)
# setup GRanges objects
a_gr <- GRanges(1, IRanges(a$x,a$x))
b_gr <- GRanges(1, IRanges(b$start, b$end))
# find overlaps between the two data sets
res <- as.data.frame(findOverlaps(a_gr,b_gr))
# create the expected output
a$y <- NA
a$y[res$queryHits] <-... |
50,583,347 | I've been trying to import a .class via absolute path while code is running and I don't know how to do it.
I found a way to import a class when it's already in project's build path by `Class.forName();`but I need to find a way to load a class that is not in build path.
The goal is:
1. User is able to upload his own ... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50583347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7111456/"
] | I eventually went to the code of fuzzy\_join and found a way to make what I want even without proper documentation. fuzzy\_let\_join doesn't work but there is the following way (not really pretty and it actually does a cartesian product):
```
g <- function(x,y) (x>y[,"start"])&(x<y[,"end"])
fuzzy_join(a,b, multi_by = ... | You can try a `GenomicRanges` solution
```
library(GenomicRanges)
# setup GRanges objects
a_gr <- GRanges(1, IRanges(a$x,a$x))
b_gr <- GRanges(1, IRanges(b$start, b$end))
# find overlaps between the two data sets
res <- as.data.frame(findOverlaps(a_gr,b_gr))
# create the expected output
a$y <- NA
a$y[res$queryHits] <-... |
50,583,347 | I've been trying to import a .class via absolute path while code is running and I don't know how to do it.
I found a way to import a class when it's already in project's build path by `Class.forName();`but I need to find a way to load a class that is not in build path.
The goal is:
1. User is able to upload his own ... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50583347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7111456/"
] | A possible answer to explain what I am trying to do : extending dplyr in some way. And I will be happy to know if there are ways to improve this solution or some problems I didn't see.
The solution avoids the cartesian product, but duplicates into lists of data frames both one of the input data frame and the result. I ... | You can try a `GenomicRanges` solution
```
library(GenomicRanges)
# setup GRanges objects
a_gr <- GRanges(1, IRanges(a$x,a$x))
b_gr <- GRanges(1, IRanges(b$start, b$end))
# find overlaps between the two data sets
res <- as.data.frame(findOverlaps(a_gr,b_gr))
# create the expected output
a$y <- NA
a$y[res$queryHits] <-... |
50,583,347 | I've been trying to import a .class via absolute path while code is running and I don't know how to do it.
I found a way to import a class when it's already in project's build path by `Class.forName();`but I need to find a way to load a class that is not in build path.
The goal is:
1. User is able to upload his own ... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50583347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7111456/"
] | For this case you don't need `multi_by` or `multy_match_fun`, this works :
```
library(fuzzyjoin)
fuzzy_left_join(a, b, by = c(x = "start", x = "end"), match_fun = list(`>`, `<`))
# x start end y
# 1 1 0 2 a
# 2 3 NA NA <NA>
# 3 5 4 6 b
``` | You can try a `GenomicRanges` solution
```
library(GenomicRanges)
# setup GRanges objects
a_gr <- GRanges(1, IRanges(a$x,a$x))
b_gr <- GRanges(1, IRanges(b$start, b$end))
# find overlaps between the two data sets
res <- as.data.frame(findOverlaps(a_gr,b_gr))
# create the expected output
a$y <- NA
a$y[res$queryHits] <-... |
50,583,347 | I've been trying to import a .class via absolute path while code is running and I don't know how to do it.
I found a way to import a class when it's already in project's build path by `Class.forName();`but I need to find a way to load a class that is not in build path.
The goal is:
1. User is able to upload his own ... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50583347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7111456/"
] | I eventually went to the code of fuzzy\_join and found a way to make what I want even without proper documentation. fuzzy\_let\_join doesn't work but there is the following way (not really pretty and it actually does a cartesian product):
```
g <- function(x,y) (x>y[,"start"])&(x<y[,"end"])
fuzzy_join(a,b, multi_by = ... | `data.table` approach could be
```r
library(data.table)
name1 <- setdiff(names(setDT(b)), names(setDT(a)))
#perform left outer join and then select required columns
a[b, (name1) := mget(name1), on = .(x > start, x < end)][, .(x, y)]
```
which gives
```
x y
1: 1 a
2: 3 <NA>
3: 5 b
```
**Sample data:*... |
50,583,347 | I've been trying to import a .class via absolute path while code is running and I don't know how to do it.
I found a way to import a class when it's already in project's build path by `Class.forName();`but I need to find a way to load a class that is not in build path.
The goal is:
1. User is able to upload his own ... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50583347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7111456/"
] | For this case you don't need `multi_by` or `multy_match_fun`, this works :
```
library(fuzzyjoin)
fuzzy_left_join(a, b, by = c(x = "start", x = "end"), match_fun = list(`>`, `<`))
# x start end y
# 1 1 0 2 a
# 2 3 NA NA <NA>
# 3 5 4 6 b
``` | `data.table` approach could be
```r
library(data.table)
name1 <- setdiff(names(setDT(b)), names(setDT(a)))
#perform left outer join and then select required columns
a[b, (name1) := mget(name1), on = .(x > start, x < end)][, .(x, y)]
```
which gives
```
x y
1: 1 a
2: 3 <NA>
3: 5 b
```
**Sample data:*... |
50,583,347 | I've been trying to import a .class via absolute path while code is running and I don't know how to do it.
I found a way to import a class when it's already in project's build path by `Class.forName();`but I need to find a way to load a class that is not in build path.
The goal is:
1. User is able to upload his own ... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50583347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7111456/"
] | I eventually went to the code of fuzzy\_join and found a way to make what I want even without proper documentation. fuzzy\_let\_join doesn't work but there is the following way (not really pretty and it actually does a cartesian product):
```
g <- function(x,y) (x>y[,"start"])&(x<y[,"end"])
fuzzy_join(a,b, multi_by = ... | A possible answer to explain what I am trying to do : extending dplyr in some way. And I will be happy to know if there are ways to improve this solution or some problems I didn't see.
The solution avoids the cartesian product, but duplicates into lists of data frames both one of the input data frame and the result. I ... |
50,583,347 | I've been trying to import a .class via absolute path while code is running and I don't know how to do it.
I found a way to import a class when it's already in project's build path by `Class.forName();`but I need to find a way to load a class that is not in build path.
The goal is:
1. User is able to upload his own ... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50583347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7111456/"
] | For this case you don't need `multi_by` or `multy_match_fun`, this works :
```
library(fuzzyjoin)
fuzzy_left_join(a, b, by = c(x = "start", x = "end"), match_fun = list(`>`, `<`))
# x start end y
# 1 1 0 2 a
# 2 3 NA NA <NA>
# 3 5 4 6 b
``` | I eventually went to the code of fuzzy\_join and found a way to make what I want even without proper documentation. fuzzy\_let\_join doesn't work but there is the following way (not really pretty and it actually does a cartesian product):
```
g <- function(x,y) (x>y[,"start"])&(x<y[,"end"])
fuzzy_join(a,b, multi_by = ... |
50,583,347 | I've been trying to import a .class via absolute path while code is running and I don't know how to do it.
I found a way to import a class when it's already in project's build path by `Class.forName();`but I need to find a way to load a class that is not in build path.
The goal is:
1. User is able to upload his own ... | 2018/05/29 | [
"https://Stackoverflow.com/questions/50583347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7111456/"
] | For this case you don't need `multi_by` or `multy_match_fun`, this works :
```
library(fuzzyjoin)
fuzzy_left_join(a, b, by = c(x = "start", x = "end"), match_fun = list(`>`, `<`))
# x start end y
# 1 1 0 2 a
# 2 3 NA NA <NA>
# 3 5 4 6 b
``` | A possible answer to explain what I am trying to do : extending dplyr in some way. And I will be happy to know if there are ways to improve this solution or some problems I didn't see.
The solution avoids the cartesian product, but duplicates into lists of data frames both one of the input data frame and the result. I ... |
44,114 | ```
[1 . 6 . 7]
[. . . 0 .]
[3 . . . .]
[. . . . 1]
[. 7 . 8 .]
```
fill the dots on the table above with 1 digit numbers, so:
>
> Number in every cell = last digit of (sum of its neighbors (including diagonals))
> or
>
> Number in every cell = The remainder of the sum of its neighbors divided by 10
> ... | 2016/10/11 | [
"https://puzzling.stackexchange.com/questions/44114",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/28756/"
] | My answer to your previous question about these grids showed that there are only two "independent" grids of this type mod 5, and all others are linear combinations of them. By looking at the middle numbers on the top and left sides we can see what combination we need. We could do the same mechanical thing for mod 2, bu... | This is my code in Haskell to generate all table with this properties
```
import Data.List
{-
a b c d e
f g h i j
k l m n o
p q r s t
u v w x y
-}
ldig xx = mod (sum xx) 10
jawab = [[[a,b,c,d,e],[f,g,h,i,j],[k,l,m,n,o],[p,q,r,s,t],[u,v,w,x,y]]|
let hm = [0..9],
a<-hm,b<-hm,f<-hm,g<-hm,
a == ld... |
45,562,577 | I'm composing a web script with Oracle OpenScript.
I recorded the actions to be performed
* open link
* select drop-down menu
* select field from drop-down menu
* save
and I'm trying to now substitute the link to be opened with a variable from a .csv I created in the assets but I get a "Error reading file" message.... | 2017/08/08 | [
"https://Stackoverflow.com/questions/45562577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8308159/"
] | Oracle Application Testing Suite (OATS) best supports csv data sheet reading.
Code you pasted is just recording you performed and not seen any issue there. and Screenshot shows error message, something might have gone wrong while creating csv.
I can suggest external excel reader , which is inbuilt in OATS itself
<htt... | I find it easier to use a databank as data provider.
By adding a CSV file with the necessary variable, you will be able to do the following substitution:
```
public void run() throws Exception {
getDatabank("databank").getNextDatabankRecord();
String v_dataFilename = "{{db.databank.filename}}";
}
``` |
28,893,736 | I need to load an external webpage into a div. I don't want to use an iFrame. And I want this done with plain Javascript or Jquery. I'm not sure how to go about it. | 2015/03/06 | [
"https://Stackoverflow.com/questions/28893736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4074117/"
] | As pointed out in <https://testdriven-ios.com>
a very good approach is to override the NSDate.date in the test case forcing it to return a known date
```
@implementation NSDate (custom)
+ (instancetype)date{
NSDateFormatter* formatter = NSDateFormatter.new;
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ssZZZ"]... | One simple workaround can be to use following approach:
1. Create a mock class that derives from the class under test.
2. Add a method like "getDate()->NSDate", in the class under test, that
returns "NSDate()"- or whatever value is expected.
3. Override the
getDate() in the mockClass. You can also create a variable ... |
28,893,736 | I need to load an external webpage into a div. I don't want to use an iFrame. And I want this done with plain Javascript or Jquery. I'm not sure how to go about it. | 2015/03/06 | [
"https://Stackoverflow.com/questions/28893736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4074117/"
] | A good way to test methods that use Date() (or CLLocationManager, ReachabilityManager, or anything else static), is to set up an environment for your entire app which can be mocked in tests.
To do this, create an Environment class like so:
```
struct Environment {
var date: () -> Date = Date.init
}
var Env = En... | One simple workaround can be to use following approach:
1. Create a mock class that derives from the class under test.
2. Add a method like "getDate()->NSDate", in the class under test, that
returns "NSDate()"- or whatever value is expected.
3. Override the
getDate() in the mockClass. You can also create a variable ... |
28,893,736 | I need to load an external webpage into a div. I don't want to use an iFrame. And I want this done with plain Javascript or Jquery. I'm not sure how to go about it. | 2015/03/06 | [
"https://Stackoverflow.com/questions/28893736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4074117/"
] | If you can use `Date.now()` like this, it will be very easy and clean to implement
```
extension Date {
static var now: (()->Date) = {
return Date()
}
}
print(Date.now())
Date.now = { Date().addingTimeInterval(43534543) }
print(Date.now())
``` | One simple workaround can be to use following approach:
1. Create a mock class that derives from the class under test.
2. Add a method like "getDate()->NSDate", in the class under test, that
returns "NSDate()"- or whatever value is expected.
3. Override the
getDate() in the mockClass. You can also create a variable ... |
28,893,736 | I need to load an external webpage into a div. I don't want to use an iFrame. And I want this done with plain Javascript or Jquery. I'm not sure how to go about it. | 2015/03/06 | [
"https://Stackoverflow.com/questions/28893736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4074117/"
] | As pointed out in <https://testdriven-ios.com>
a very good approach is to override the NSDate.date in the test case forcing it to return a known date
```
@implementation NSDate (custom)
+ (instancetype)date{
NSDateFormatter* formatter = NSDateFormatter.new;
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ssZZZ"]... | NSDate.date (Objective C), Date() (Swift), Date.now() in other languages, are all problematic to mock, because they are *supposed* to give different results on different calls.
So if I add an object to a database with the current date, and check that when I read it from the database it has the current date, that's not... |
28,893,736 | I need to load an external webpage into a div. I don't want to use an iFrame. And I want this done with plain Javascript or Jquery. I'm not sure how to go about it. | 2015/03/06 | [
"https://Stackoverflow.com/questions/28893736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4074117/"
] | A good way to test methods that use Date() (or CLLocationManager, ReachabilityManager, or anything else static), is to set up an environment for your entire app which can be mocked in tests.
To do this, create an Environment class like so:
```
struct Environment {
var date: () -> Date = Date.init
}
var Env = En... | NSDate.date (Objective C), Date() (Swift), Date.now() in other languages, are all problematic to mock, because they are *supposed* to give different results on different calls.
So if I add an object to a database with the current date, and check that when I read it from the database it has the current date, that's not... |
28,893,736 | I need to load an external webpage into a div. I don't want to use an iFrame. And I want this done with plain Javascript or Jquery. I'm not sure how to go about it. | 2015/03/06 | [
"https://Stackoverflow.com/questions/28893736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4074117/"
] | If you can use `Date.now()` like this, it will be very easy and clean to implement
```
extension Date {
static var now: (()->Date) = {
return Date()
}
}
print(Date.now())
Date.now = { Date().addingTimeInterval(43534543) }
print(Date.now())
``` | NSDate.date (Objective C), Date() (Swift), Date.now() in other languages, are all problematic to mock, because they are *supposed* to give different results on different calls.
So if I add an object to a database with the current date, and check that when I read it from the database it has the current date, that's not... |
24,577,792 | What do I have?
* Google Account.
* Simple API Key access.
* I have created a Custom Search Engine, I've set **Search the entire web but emphasize included sites** in it, and I have removed all the links from **Sites to search** section (so that it searched the entire web, and it's not restricted to a certain website)... | 2014/07/04 | [
"https://Stackoverflow.com/questions/24577792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1163533/"
] | With this api <https://developers.google.com/custom-search/json-api/v1/using_rest>, You have to give some sites to search, If you didn't provide the sites to search here(<https://www.google.com/cse/all>), It will not show you the results. At least put one site to search, or many sites to search. Your wanted Google Web ... | I also faced the same issue,
after research i found that i didnt provide sites in search engine which i created
so i provide www.google.com as a site in search engine page
here is the link to add site in your search engine
<https://www.google.com/cse/setup/basic?cx=>{your search engine id}
after executing above link ... |
41,433,965 | I have a query which gives me list of total counts of different items, as:
```
$data = DB::table($Table1)
->join($table2,$Table1.'.id','=',$Table2.'.device_key')
->where($Table1.'.created_at', '>', $value)
->select('item', DB::raw('count(*) as total'))
->grou... | 2017/01/02 | [
"https://Stackoverflow.com/questions/41433965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3809745/"
] | I don't think you'll get away with anything nice than this.
```
$query = DB::table($Table1)
->join($table2,$Table1.'.id','=',$Table2.'.device_key')
->where($Table1.'.created_at', '>', $value)
->select('item', DB::raw('count(*) as total'))
->groupBy('item');
$... | Use clone to copy the query object for modifications.
```
$query = DB::table()->where();
$clonedQuery = clone $query;
$clonedQuery->where(..);
``` |
35,994,640 | To convert HTML to jade is use this [jade converter](http://html2jade.aaron-powell.com/).
When I enter the following HTML,
```
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
</head>
<body>
<div class="container">
<div class="header">
<ul class="nav nav-pills pull-right"... | 2016/03/14 | [
"https://Stackoverflow.com/questions/35994640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4670075/"
] | It is just a better visualization of plain text in jade templates. see <https://pugjs.org/language/plain-text.html> | Quick update to @burnedikt's answer. Since Jade is now Pug due to a copyright issue with the word "Jade", the website has also changed. The current link is <https://pugjs.org/language/plain-text.html#piped-text>.
FYI what it says is simply:
>
> Another way to add plain text to templates is to prefix a line with a pi... |
59,267,975 | I wrote a SP which will call internally another parameterized SP and output will be store into a physical table.While I am executing Outer SP I am getting following error.
>
> Msg 207, Level 16, State 1, Procedure CBs\_LargeExposer, Line 88 [Batch
> Start Line 12] Invalid column name 'SlNo'.
>
>
>
I observed, if... | 2019/12/10 | [
"https://Stackoverflow.com/questions/59267975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12510748/"
] | So I ended up fixing this problem by overriding how the anchor tag helper works and making sure it always passes in the culture from the route.
This is the custom tag helper:
```
[HtmlTargetElement("a", Attributes = ActionAttributeName)]
[HtmlTargetElement("a", Attributes = ControllerAttributeName)]
[HtmlTargetElemen... | @herostwist, your solution saved my day :)
just a simplified version of it:
```cs
//...
public CultureAnchorTagHelper(IHtmlGenerator generator) : base(generator)
{
RouteValues["culture"] = CultureInfo.CurrentCulture.Name;
}
``` |
11,629,444 | So is it possible to do all the development of a Java daemon (Apache Daemon) on a Windows 7 machine, then install the service on Ubuntu server (still have to search how to do that) which has OpenJDK installed ?
If yes, how can I identify the compatible versions of Java on both systems ? I mean if I'm using Java 1.6 on... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11629444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/897041/"
] | Mostly yes, but for corner cases it depends and should be carefully tested on stage that match closely to production configuration.
Here are examples of compiler crash and test failure that occurs on OpenJDK, while the same snapshot of sources are green when build by Oracle JDK:
<http://travis-ci.org/#!/plokhotnyuk/a... | Java byte code is portable and can be executed using any JVM that has same or newer version. |
11,629,444 | So is it possible to do all the development of a Java daemon (Apache Daemon) on a Windows 7 machine, then install the service on Ubuntu server (still have to search how to do that) which has OpenJDK installed ?
If yes, how can I identify the compatible versions of Java on both systems ? I mean if I'm using Java 1.6 on... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11629444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/897041/"
] | Java byte code is portable and can be executed using any JVM that has same or newer version. | No, that's not but you have nothing to worry about this.Java is a standardized platform, you should be able to compile and run on any implementation of it. Just as long as you keep the version in mind. Java 7 software is not going to run on a Java 6 installation completely. Java 6 software does work on a Java 7 install... |
11,629,444 | So is it possible to do all the development of a Java daemon (Apache Daemon) on a Windows 7 machine, then install the service on Ubuntu server (still have to search how to do that) which has OpenJDK installed ?
If yes, how can I identify the compatible versions of Java on both systems ? I mean if I'm using Java 1.6 on... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11629444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/897041/"
] | Java byte code is portable and can be executed using any JVM that has same or newer version. | If you have compiled for Java 1.6, you need at least OpenJDK 1.6. There are rare cases where Hotspot and OpenJDK are different but since Hotspot is based on the OpenJDK you are more likely to see minor differences in build versions.
Both JVMs comply with the JLS spec and IMHO are practically reference implementations.... |
11,629,444 | So is it possible to do all the development of a Java daemon (Apache Daemon) on a Windows 7 machine, then install the service on Ubuntu server (still have to search how to do that) which has OpenJDK installed ?
If yes, how can I identify the compatible versions of Java on both systems ? I mean if I'm using Java 1.6 on... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11629444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/897041/"
] | Mostly yes, but for corner cases it depends and should be carefully tested on stage that match closely to production configuration.
Here are examples of compiler crash and test failure that occurs on OpenJDK, while the same snapshot of sources are green when build by Oracle JDK:
<http://travis-ci.org/#!/plokhotnyuk/a... | No, that's not but you have nothing to worry about this.Java is a standardized platform, you should be able to compile and run on any implementation of it. Just as long as you keep the version in mind. Java 7 software is not going to run on a Java 6 installation completely. Java 6 software does work on a Java 7 install... |
11,629,444 | So is it possible to do all the development of a Java daemon (Apache Daemon) on a Windows 7 machine, then install the service on Ubuntu server (still have to search how to do that) which has OpenJDK installed ?
If yes, how can I identify the compatible versions of Java on both systems ? I mean if I'm using Java 1.6 on... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11629444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/897041/"
] | Mostly yes, but for corner cases it depends and should be carefully tested on stage that match closely to production configuration.
Here are examples of compiler crash and test failure that occurs on OpenJDK, while the same snapshot of sources are green when build by Oracle JDK:
<http://travis-ci.org/#!/plokhotnyuk/a... | If you have compiled for Java 1.6, you need at least OpenJDK 1.6. There are rare cases where Hotspot and OpenJDK are different but since Hotspot is based on the OpenJDK you are more likely to see minor differences in build versions.
Both JVMs comply with the JLS spec and IMHO are practically reference implementations.... |
11,629,444 | So is it possible to do all the development of a Java daemon (Apache Daemon) on a Windows 7 machine, then install the service on Ubuntu server (still have to search how to do that) which has OpenJDK installed ?
If yes, how can I identify the compatible versions of Java on both systems ? I mean if I'm using Java 1.6 on... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11629444",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/897041/"
] | If you have compiled for Java 1.6, you need at least OpenJDK 1.6. There are rare cases where Hotspot and OpenJDK are different but since Hotspot is based on the OpenJDK you are more likely to see minor differences in build versions.
Both JVMs comply with the JLS spec and IMHO are practically reference implementations.... | No, that's not but you have nothing to worry about this.Java is a standardized platform, you should be able to compile and run on any implementation of it. Just as long as you keep the version in mind. Java 7 software is not going to run on a Java 6 installation completely. Java 6 software does work on a Java 7 install... |
79,984 | I want to understand Prop 6 in the paper "[Convergence of the Q-curvarture flow on $S^4$](http://dx.doi.org/10.1016/j.aim.2005.07.002)" by Simon Brendle. I understand that for every $p\in B^4$, where $B^4=\{x\in\mathbb{R}^5: |x|\leq 1\}$,
$$\phi(x)=p+\frac{1-|p|^2}{1+2\langle p,x\rangle+|p|^2}(x+p)
$$defines a conform... | 2011/11/03 | [
"https://mathoverflow.net/questions/79984",
"https://mathoverflow.net",
"https://mathoverflow.net/users/14579/"
] | Conformal diffeomorphisms of $S^n$ correspond to hyperbolic isometries of hyperbolic space $\mathbb H^{n+1}$ -- the idea is to think of $S^n$ as the visual sphere for hyperbolic space, all conformal diffeos extend uniquely to a hyperbolic isometry.
For (ii), no. Hyperbolic isometries have various forms. Your $\phi$ d... | Another approach to conformal maps is to use stereographic projection and work on $R^n$. There, you basically want to show that the only conformal maps are higher dimensional analogues of Mobius transformations. I'm not sure, but i think the survey article by Lee and Parker on the Yamabe problem in the Bulletin of the ... |
79,984 | I want to understand Prop 6 in the paper "[Convergence of the Q-curvarture flow on $S^4$](http://dx.doi.org/10.1016/j.aim.2005.07.002)" by Simon Brendle. I understand that for every $p\in B^4$, where $B^4=\{x\in\mathbb{R}^5: |x|\leq 1\}$,
$$\phi(x)=p+\frac{1-|p|^2}{1+2\langle p,x\rangle+|p|^2}(x+p)
$$defines a conform... | 2011/11/03 | [
"https://mathoverflow.net/questions/79984",
"https://mathoverflow.net",
"https://mathoverflow.net/users/14579/"
] | Conformal diffeomorphisms of $S^n$ correspond to hyperbolic isometries of hyperbolic space $\mathbb H^{n+1}$ -- the idea is to think of $S^n$ as the visual sphere for hyperbolic space, all conformal diffeos extend uniquely to a hyperbolic isometry.
For (ii), no. Hyperbolic isometries have various forms. Your $\phi$ d... | See my [answer](https://mathoverflow.net/questions/60687/the-conformal-group-of-sn/60731#60731) to a question about conformal diffeomorphims of a sphere. |
79,984 | I want to understand Prop 6 in the paper "[Convergence of the Q-curvarture flow on $S^4$](http://dx.doi.org/10.1016/j.aim.2005.07.002)" by Simon Brendle. I understand that for every $p\in B^4$, where $B^4=\{x\in\mathbb{R}^5: |x|\leq 1\}$,
$$\phi(x)=p+\frac{1-|p|^2}{1+2\langle p,x\rangle+|p|^2}(x+p)
$$defines a conform... | 2011/11/03 | [
"https://mathoverflow.net/questions/79984",
"https://mathoverflow.net",
"https://mathoverflow.net/users/14579/"
] | Conformal diffeomorphisms of $S^n$ correspond to hyperbolic isometries of hyperbolic space $\mathbb H^{n+1}$ -- the idea is to think of $S^n$ as the visual sphere for hyperbolic space, all conformal diffeos extend uniquely to a hyperbolic isometry.
For (ii), no. Hyperbolic isometries have various forms. Your $\phi$ d... | Here is a geometric illustration for the conformal map $\phi$ on $S^1$. On $S^n$ this is the same.
[The conformal map $\phi$ on $S^1$](https://i.stack.imgur.com/M4MCJ.png)
I hope this is enough to realize the formule given by Brendle in his paper. |
79,984 | I want to understand Prop 6 in the paper "[Convergence of the Q-curvarture flow on $S^4$](http://dx.doi.org/10.1016/j.aim.2005.07.002)" by Simon Brendle. I understand that for every $p\in B^4$, where $B^4=\{x\in\mathbb{R}^5: |x|\leq 1\}$,
$$\phi(x)=p+\frac{1-|p|^2}{1+2\langle p,x\rangle+|p|^2}(x+p)
$$defines a conform... | 2011/11/03 | [
"https://mathoverflow.net/questions/79984",
"https://mathoverflow.net",
"https://mathoverflow.net/users/14579/"
] | Conformal diffeomorphisms of $S^n$ correspond to hyperbolic isometries of hyperbolic space $\mathbb H^{n+1}$ -- the idea is to think of $S^n$ as the visual sphere for hyperbolic space, all conformal diffeos extend uniquely to a hyperbolic isometry.
For (ii), no. Hyperbolic isometries have various forms. Your $\phi$ d... | When I first saw this equation, I think it was just the inversion of unit sphere with respect to some sphere with center $-p$ and radius $r$, then I tried to write it in a form that look likes inversion:
$$\varphi=\frac{1-|p|^2}{|x+p|}\cdot\frac{x+p}{|x+p|}+p$$
So actually you fix point $p$ first, then draw a sphere $T... |
79,984 | I want to understand Prop 6 in the paper "[Convergence of the Q-curvarture flow on $S^4$](http://dx.doi.org/10.1016/j.aim.2005.07.002)" by Simon Brendle. I understand that for every $p\in B^4$, where $B^4=\{x\in\mathbb{R}^5: |x|\leq 1\}$,
$$\phi(x)=p+\frac{1-|p|^2}{1+2\langle p,x\rangle+|p|^2}(x+p)
$$defines a conform... | 2011/11/03 | [
"https://mathoverflow.net/questions/79984",
"https://mathoverflow.net",
"https://mathoverflow.net/users/14579/"
] | Another approach to conformal maps is to use stereographic projection and work on $R^n$. There, you basically want to show that the only conformal maps are higher dimensional analogues of Mobius transformations. I'm not sure, but i think the survey article by Lee and Parker on the Yamabe problem in the Bulletin of the ... | See my [answer](https://mathoverflow.net/questions/60687/the-conformal-group-of-sn/60731#60731) to a question about conformal diffeomorphims of a sphere. |
79,984 | I want to understand Prop 6 in the paper "[Convergence of the Q-curvarture flow on $S^4$](http://dx.doi.org/10.1016/j.aim.2005.07.002)" by Simon Brendle. I understand that for every $p\in B^4$, where $B^4=\{x\in\mathbb{R}^5: |x|\leq 1\}$,
$$\phi(x)=p+\frac{1-|p|^2}{1+2\langle p,x\rangle+|p|^2}(x+p)
$$defines a conform... | 2011/11/03 | [
"https://mathoverflow.net/questions/79984",
"https://mathoverflow.net",
"https://mathoverflow.net/users/14579/"
] | Another approach to conformal maps is to use stereographic projection and work on $R^n$. There, you basically want to show that the only conformal maps are higher dimensional analogues of Mobius transformations. I'm not sure, but i think the survey article by Lee and Parker on the Yamabe problem in the Bulletin of the ... | Here is a geometric illustration for the conformal map $\phi$ on $S^1$. On $S^n$ this is the same.
[The conformal map $\phi$ on $S^1$](https://i.stack.imgur.com/M4MCJ.png)
I hope this is enough to realize the formule given by Brendle in his paper. |
79,984 | I want to understand Prop 6 in the paper "[Convergence of the Q-curvarture flow on $S^4$](http://dx.doi.org/10.1016/j.aim.2005.07.002)" by Simon Brendle. I understand that for every $p\in B^4$, where $B^4=\{x\in\mathbb{R}^5: |x|\leq 1\}$,
$$\phi(x)=p+\frac{1-|p|^2}{1+2\langle p,x\rangle+|p|^2}(x+p)
$$defines a conform... | 2011/11/03 | [
"https://mathoverflow.net/questions/79984",
"https://mathoverflow.net",
"https://mathoverflow.net/users/14579/"
] | Another approach to conformal maps is to use stereographic projection and work on $R^n$. There, you basically want to show that the only conformal maps are higher dimensional analogues of Mobius transformations. I'm not sure, but i think the survey article by Lee and Parker on the Yamabe problem in the Bulletin of the ... | When I first saw this equation, I think it was just the inversion of unit sphere with respect to some sphere with center $-p$ and radius $r$, then I tried to write it in a form that look likes inversion:
$$\varphi=\frac{1-|p|^2}{|x+p|}\cdot\frac{x+p}{|x+p|}+p$$
So actually you fix point $p$ first, then draw a sphere $T... |
3,565,988 | If i have a button pressed method like this:
```
$('#next').click(function () {
});
```
How can i stop this method being initiated whilst its running. Say the method takes 5 seconds to run and someone clicks it 3 seconds in it breaks so i want to make the div thats being clicked unclickable while the methods running... | 2010/08/25 | [
"https://Stackoverflow.com/questions/3565988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/378022/"
] | Replace the clicked link with `<p>loading...</p>` | ```
$('#next').click(function () {
$(this).attr("disabled", "disabled");
stuffff
$(this).attr("disabled", "");
});
``` |
3,565,988 | If i have a button pressed method like this:
```
$('#next').click(function () {
});
```
How can i stop this method being initiated whilst its running. Say the method takes 5 seconds to run and someone clicks it 3 seconds in it breaks so i want to make the div thats being clicked unclickable while the methods running... | 2010/08/25 | [
"https://Stackoverflow.com/questions/3565988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/378022/"
] | ```
$('#next').click(function () {
$(this).attr("disabled", "disabled");
stuffff
$(this).attr("disabled", "");
});
``` | You can use "disabled" to disable the button while your execution, as like byron said |
3,565,988 | If i have a button pressed method like this:
```
$('#next').click(function () {
});
```
How can i stop this method being initiated whilst its running. Say the method takes 5 seconds to run and someone clicks it 3 seconds in it breaks so i want to make the div thats being clicked unclickable while the methods running... | 2010/08/25 | [
"https://Stackoverflow.com/questions/3565988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/378022/"
] | Replace the clicked link with `<p>loading...</p>` | You can use "disabled" to disable the button while your execution, as like byron said |
57,612,712 | I'm trying to setup a parent > child relationship, in which the parent is scrollable but the child does not scroll and stays fixed at top 50%.
I have tried using multiple positions and means of separating the child from the parent but it is important that this relationship stays the same. This is for a mega-menu in wh... | 2019/08/22 | [
"https://Stackoverflow.com/questions/57612712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11963448/"
] | The problem is that Keras for R creates its own virtual environment, called `r-reticulate`, and pillow is missing in there. You also have to find out whether it used conda or virtualenv to create such environment. Then, activate it and install pillow and scipy. Finally, restart the R session.
In my case it was conda:
... | It's an old question, but this is what worked for me just now: use `reticulate::py_install("pillow")` to install any missing packages into the reticulate environment directly. |
47,472,689 | I have the following T-SQL query which I'm trying to convert into C# code:
```sql
SELECT
*, DATEFROMPARTS(Jaar, Maand, 1)
FROM
EAN_Budget_Meetdata_Factuur
WHERE
EID = 1 AND
Bron = 'B' AND
DATEFROMPARTS(Jaar, Maand, 1) BETWEEN '20161101' AND '20170101'
```
The table contains a column Year and... | 2017/11/24 | [
"https://Stackoverflow.com/questions/47472689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453213/"
] | You can use cursor option available with aggregate query pipeline.
```
{cursor: { batchSize: batch_size }}
```
<https://docs.mongodb.com/manual/reference/method/db.collection.aggregate/>
`Aggregation.newAggregation(AggregationOperation... operations).withOptions(new AggregationOptions(false,false,new Document().app... | Your command no longer works due to a change in mongodb driver change in version `3.6`.
You need to invoke it from `dbCollection.aggregate(...)` method instead. |
47,472,689 | I have the following T-SQL query which I'm trying to convert into C# code:
```sql
SELECT
*, DATEFROMPARTS(Jaar, Maand, 1)
FROM
EAN_Budget_Meetdata_Factuur
WHERE
EID = 1 AND
Bron = 'B' AND
DATEFROMPARTS(Jaar, Maand, 1) BETWEEN '20161101' AND '20170101'
```
The table contains a column Year and... | 2017/11/24 | [
"https://Stackoverflow.com/questions/47472689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453213/"
] | It seems Pull Request mentionned by @mp911de has been release in version 1.10.10 of Spring Data MongoDB.
So you can either
* upgrade your Spring Data MongoDB dependency to 1.10.10.RELEASE
* upgrade your spring-boot-starter-data-mongodb dependency to 1.5.10.RELEASE | I have also faced this type of error when using org.springframework.data version 1.10.3.RELEASE. And then i have changed version to 2.0.5.RELEASE and my problem was solved. |
47,472,689 | I have the following T-SQL query which I'm trying to convert into C# code:
```sql
SELECT
*, DATEFROMPARTS(Jaar, Maand, 1)
FROM
EAN_Budget_Meetdata_Factuur
WHERE
EID = 1 AND
Bron = 'B' AND
DATEFROMPARTS(Jaar, Maand, 1) BETWEEN '20161101' AND '20170101'
```
The table contains a column Year and... | 2017/11/24 | [
"https://Stackoverflow.com/questions/47472689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453213/"
] | I have also faced this type of error when using Mongodb version 3.6.2.
Check your version of ***org.springframework.data*** in pom.xml
For me, i have changed **org.springframework.data** version to 2.0.3.RELEASE and my problem was solved. | 1. Use Spring Boot 2.0.0 or later.
2. Add `AggregationOptions` with cursor to your `Aggregation`:
```java
AggregationOptions aggregationOptions = AggregationOptions.builder()
.allowDiskUse(true)
.cursor(new Document())
.build();
Aggregation aggregation = Aggregation.newAggregation(aggregationOperations)
... |
47,472,689 | I have the following T-SQL query which I'm trying to convert into C# code:
```sql
SELECT
*, DATEFROMPARTS(Jaar, Maand, 1)
FROM
EAN_Budget_Meetdata_Factuur
WHERE
EID = 1 AND
Bron = 'B' AND
DATEFROMPARTS(Jaar, Maand, 1) BETWEEN '20161101' AND '20170101'
```
The table contains a column Year and... | 2017/11/24 | [
"https://Stackoverflow.com/questions/47472689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453213/"
] | ```
Just updating the spring boot version works for me.
This is the version that I have used and worked....
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
``` | I've tried all above (short of changing the code to using a cursor) to no avail.
In the end, I had to upgrage
```
'mongo-java-driver' : '3.6.2'
```
Then it worked. |
47,472,689 | I have the following T-SQL query which I'm trying to convert into C# code:
```sql
SELECT
*, DATEFROMPARTS(Jaar, Maand, 1)
FROM
EAN_Budget_Meetdata_Factuur
WHERE
EID = 1 AND
Bron = 'B' AND
DATEFROMPARTS(Jaar, Maand, 1) BETWEEN '20161101' AND '20170101'
```
The table contains a column Year and... | 2017/11/24 | [
"https://Stackoverflow.com/questions/47472689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453213/"
] | It seems Pull Request mentionned by @mp911de has been release in version 1.10.10 of Spring Data MongoDB.
So you can either
* upgrade your Spring Data MongoDB dependency to 1.10.10.RELEASE
* upgrade your spring-boot-starter-data-mongodb dependency to 1.5.10.RELEASE | 1. Use Spring Boot 2.0.0 or later.
2. Add `AggregationOptions` with cursor to your `Aggregation`:
```java
AggregationOptions aggregationOptions = AggregationOptions.builder()
.allowDiskUse(true)
.cursor(new Document())
.build();
Aggregation aggregation = Aggregation.newAggregation(aggregationOperations)
... |
47,472,689 | I have the following T-SQL query which I'm trying to convert into C# code:
```sql
SELECT
*, DATEFROMPARTS(Jaar, Maand, 1)
FROM
EAN_Budget_Meetdata_Factuur
WHERE
EID = 1 AND
Bron = 'B' AND
DATEFROMPARTS(Jaar, Maand, 1) BETWEEN '20161101' AND '20170101'
```
The table contains a column Year and... | 2017/11/24 | [
"https://Stackoverflow.com/questions/47472689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453213/"
] | MongoDB changed in 3.6 how the aggregation command works. Aggregations require now a cursor. We [adapted Spring Data MongoDB 2.1](https://github.com/spring-projects/spring-data-mongodb/pull/515) but not previous versions.
Aggregations must be invoked through the collection's `aggregate(…)` method instead of calling t... | Your command no longer works due to a change in mongodb driver change in version `3.6`.
You need to invoke it from `dbCollection.aggregate(...)` method instead. |
47,472,689 | I have the following T-SQL query which I'm trying to convert into C# code:
```sql
SELECT
*, DATEFROMPARTS(Jaar, Maand, 1)
FROM
EAN_Budget_Meetdata_Factuur
WHERE
EID = 1 AND
Bron = 'B' AND
DATEFROMPARTS(Jaar, Maand, 1) BETWEEN '20161101' AND '20170101'
```
The table contains a column Year and... | 2017/11/24 | [
"https://Stackoverflow.com/questions/47472689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453213/"
] | MongoDB changed in 3.6 how the aggregation command works. Aggregations require now a cursor. We [adapted Spring Data MongoDB 2.1](https://github.com/spring-projects/spring-data-mongodb/pull/515) but not previous versions.
Aggregations must be invoked through the collection's `aggregate(…)` method instead of calling t... | 1. Use Spring Boot 2.0.0 or later.
2. Add `AggregationOptions` with cursor to your `Aggregation`:
```java
AggregationOptions aggregationOptions = AggregationOptions.builder()
.allowDiskUse(true)
.cursor(new Document())
.build();
Aggregation aggregation = Aggregation.newAggregation(aggregationOperations)
... |
47,472,689 | I have the following T-SQL query which I'm trying to convert into C# code:
```sql
SELECT
*, DATEFROMPARTS(Jaar, Maand, 1)
FROM
EAN_Budget_Meetdata_Factuur
WHERE
EID = 1 AND
Bron = 'B' AND
DATEFROMPARTS(Jaar, Maand, 1) BETWEEN '20161101' AND '20170101'
```
The table contains a column Year and... | 2017/11/24 | [
"https://Stackoverflow.com/questions/47472689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453213/"
] | I was using:
```
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.8.RELEASE</version>
<relativePath></relativePath>
</parent>
```
Then after upgraded my dependency to a higher version, the issue was resolved:
```
<parent>
<grou... | I have also faced this type of error when using org.springframework.data version 1.10.3.RELEASE. And then i have changed version to 2.0.5.RELEASE and my problem was solved. |
47,472,689 | I have the following T-SQL query which I'm trying to convert into C# code:
```sql
SELECT
*, DATEFROMPARTS(Jaar, Maand, 1)
FROM
EAN_Budget_Meetdata_Factuur
WHERE
EID = 1 AND
Bron = 'B' AND
DATEFROMPARTS(Jaar, Maand, 1) BETWEEN '20161101' AND '20170101'
```
The table contains a column Year and... | 2017/11/24 | [
"https://Stackoverflow.com/questions/47472689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453213/"
] | ```
Just updating the spring boot version works for me.
This is the version that I have used and worked....
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
``` | I have also faced this type of error when using org.springframework.data version 1.10.3.RELEASE. And then i have changed version to 2.0.5.RELEASE and my problem was solved. |
47,472,689 | I have the following T-SQL query which I'm trying to convert into C# code:
```sql
SELECT
*, DATEFROMPARTS(Jaar, Maand, 1)
FROM
EAN_Budget_Meetdata_Factuur
WHERE
EID = 1 AND
Bron = 'B' AND
DATEFROMPARTS(Jaar, Maand, 1) BETWEEN '20161101' AND '20170101'
```
The table contains a column Year and... | 2017/11/24 | [
"https://Stackoverflow.com/questions/47472689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1453213/"
] | MongoDB changed in 3.6 how the aggregation command works. Aggregations require now a cursor. We [adapted Spring Data MongoDB 2.1](https://github.com/spring-projects/spring-data-mongodb/pull/515) but not previous versions.
Aggregations must be invoked through the collection's `aggregate(…)` method instead of calling t... | I've tried all above (short of changing the code to using a cursor) to no avail.
In the end, I had to upgrage
```
'mongo-java-driver' : '3.6.2'
```
Then it worked. |
36,028,646 | I want to increase the size of hyper-link in both direction(left and right), when text inside changes.
When text inside selected.name changes, it should be expand in both direction. Currently it is expanding in only right direction. I want to expand in both direction when text changes...
HTML
```
<a ng-model="link... | 2016/03/16 | [
"https://Stackoverflow.com/questions/36028646",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5910006/"
] | you need to remove `float: left` to expand the link in both direction and add following
`min-width:200px; /*optional*/
display:block;
margin:auto;`
Thanks | You can try by giving a specific `width` maybe a `min-width` and have `text-align: center;` that should help you with your requirement. |
53,498,662 | I need to display rows within a table using php variables and a while loop and I can't figure out what I am doing wrong. I have tried all kinds of different combinations of single quotes and double quotes, but I still can't use the correct syntax needed to make these rows get outputted within the table without generati... | 2018/11/27 | [
"https://Stackoverflow.com/questions/53498662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10711172/"
] | Better approach would be a step closer to a template-like solution.
```
<tbody>
<?php while($result = $stmt->fetch()): ?>
<tr>
<td clas="text-center">#</td>
<td><?php echo $id; ?> </td>
<td><?php echo $first_name; ?> </td>
<td><?php echo $last_name; ?> </td>
<td class="text-center">Detai... | try using below code
write this way `'$id, $last_name, $firs_name`
```
<?php
while($result = $stmt->fetch()) {
echo '<th class="text-center">#</th>';
echo '<th>'.$id.'</th>';
echo '<th>'.$lastt_name.'</th>';
echo '<th>'.$first_name.'</th>';
echo '<th class="text-center">Det... |
53,498,662 | I need to display rows within a table using php variables and a while loop and I can't figure out what I am doing wrong. I have tried all kinds of different combinations of single quotes and double quotes, but I still can't use the correct syntax needed to make these rows get outputted within the table without generati... | 2018/11/27 | [
"https://Stackoverflow.com/questions/53498662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10711172/"
] | Because you have used `$stmt->bind_result($id, $first_name, $last_name);` then the columns you select will be returned by `$stmt->fetch()` into variables called `$id`, `$first_name`, `$last_name`
Also remember each `echo` is a distinct statement and should end with a `;`
Also note that when using double quoted string... | try using below code
write this way `'$id, $last_name, $firs_name`
```
<?php
while($result = $stmt->fetch()) {
echo '<th class="text-center">#</th>';
echo '<th>'.$id.'</th>';
echo '<th>'.$lastt_name.'</th>';
echo '<th>'.$first_name.'</th>';
echo '<th class="text-center">Det... |
53,498,662 | I need to display rows within a table using php variables and a while loop and I can't figure out what I am doing wrong. I have tried all kinds of different combinations of single quotes and double quotes, but I still can't use the correct syntax needed to make these rows get outputted within the table without generati... | 2018/11/27 | [
"https://Stackoverflow.com/questions/53498662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10711172/"
] | Better approach would be a step closer to a template-like solution.
```
<tbody>
<?php while($result = $stmt->fetch()): ?>
<tr>
<td clas="text-center">#</td>
<td><?php echo $id; ?> </td>
<td><?php echo $first_name; ?> </td>
<td><?php echo $last_name; ?> </td>
<td class="text-center">Detai... | First you need to understand how to use the loop. Your code within the loop is not correct. There are many quotes issues. Moreover, as per your code I believe you are fetching the table and not using the columns in the loop, something like `$result['id']` or `$result->id`
You also may need to understand how PHP Concat... |
53,498,662 | I need to display rows within a table using php variables and a while loop and I can't figure out what I am doing wrong. I have tried all kinds of different combinations of single quotes and double quotes, but I still can't use the correct syntax needed to make these rows get outputted within the table without generati... | 2018/11/27 | [
"https://Stackoverflow.com/questions/53498662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10711172/"
] | Better approach would be a step closer to a template-like solution.
```
<tbody>
<?php while($result = $stmt->fetch()): ?>
<tr>
<td clas="text-center">#</td>
<td><?php echo $id; ?> </td>
<td><?php echo $first_name; ?> </td>
<td><?php echo $last_name; ?> </td>
<td class="text-center">Detai... | Try using `<?=$string; ?>`, like this:
```
<?php while($result = $stmt->fetch()): ?>
<tr>
<td clas="text-center">#</td>
<td><?=$id; ?> </td>
<td><?=$first_name; ?> </td>
<td><?=$last_name; ?> </td>
<td class="text-center">Details</td>
</tr>
<?php endwhile; ?>
```
Using less php in your ht... |
53,498,662 | I need to display rows within a table using php variables and a while loop and I can't figure out what I am doing wrong. I have tried all kinds of different combinations of single quotes and double quotes, but I still can't use the correct syntax needed to make these rows get outputted within the table without generati... | 2018/11/27 | [
"https://Stackoverflow.com/questions/53498662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10711172/"
] | Because you have used `$stmt->bind_result($id, $first_name, $last_name);` then the columns you select will be returned by `$stmt->fetch()` into variables called `$id`, `$first_name`, `$last_name`
Also remember each `echo` is a distinct statement and should end with a `;`
Also note that when using double quoted string... | First you need to understand how to use the loop. Your code within the loop is not correct. There are many quotes issues. Moreover, as per your code I believe you are fetching the table and not using the columns in the loop, something like `$result['id']` or `$result->id`
You also may need to understand how PHP Concat... |
53,498,662 | I need to display rows within a table using php variables and a while loop and I can't figure out what I am doing wrong. I have tried all kinds of different combinations of single quotes and double quotes, but I still can't use the correct syntax needed to make these rows get outputted within the table without generati... | 2018/11/27 | [
"https://Stackoverflow.com/questions/53498662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10711172/"
] | Because you have used `$stmt->bind_result($id, $first_name, $last_name);` then the columns you select will be returned by `$stmt->fetch()` into variables called `$id`, `$first_name`, `$last_name`
Also remember each `echo` is a distinct statement and should end with a `;`
Also note that when using double quoted string... | Try using `<?=$string; ?>`, like this:
```
<?php while($result = $stmt->fetch()): ?>
<tr>
<td clas="text-center">#</td>
<td><?=$id; ?> </td>
<td><?=$first_name; ?> </td>
<td><?=$last_name; ?> </td>
<td class="text-center">Details</td>
</tr>
<?php endwhile; ?>
```
Using less php in your ht... |
7,083,568 | Trying to use SQL Server with a jQuery autocomplete. I can get the following to work when just checking the term entered with a matching domain, but I would also like the autocomplete to check if a match is found for the contact name (first name and last name).
Is there a way (like in mySQL) to concat the fname and ln... | 2011/08/16 | [
"https://Stackoverflow.com/questions/7083568",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/708831/"
] | 1. Yes, some pages will need different combinations of style sheets. Each combination must be cached individually. Unfortunately, the browser won't know that there isn't a difference between `?stylesheets=a.css,b.css` and `?stylesheets=b.css,a.css` so both will need to be cached.
2. That's used to make sure the browser... | [Assetic](https://github.com/kriswallsmith/assetic) seems to be good at making assets of JS/CSS and minify them while putting them in cache. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.