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 |
|---|---|---|---|---|---|
15,951,772 | looking at the magic installers which appear for all types of projects (e.g. for rvm) you'll always see commands like:
```
\curl ... | bash
```
e.g.
```
\curl -L https://get.rvm.io | bash -s stable
```
And I was wondering why these commands start with a slash - they seem to run fine without it.
Any suggestions? | 2013/04/11 | [
"https://Stackoverflow.com/questions/15951772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116932/"
] | This is used to call the "original" command, avoiding it to be called with the possible aliases. That is, disables the possible aliases on the command `curl` and adjusts to the original one.
If you have
```
alias grep='grep --color=auto'
```
and then you do `grep`, it will have colours. So if you do not want colour... | it's a backslash
it is to start the command starting with that name (OR the function) but not the ALIAS.
To make sure to bypass both **function** AND **alias** :
```
command somecommand
```
To bypass **just the alias** (and thus launch a function, or if no function, the command):
```
\somecommand
```
Let's see ... |
15,951,772 | looking at the magic installers which appear for all types of projects (e.g. for rvm) you'll always see commands like:
```
\curl ... | bash
```
e.g.
```
\curl -L https://get.rvm.io | bash -s stable
```
And I was wondering why these commands start with a slash - they seem to run fine without it.
Any suggestions? | 2013/04/11 | [
"https://Stackoverflow.com/questions/15951772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116932/"
] | This is used to call the "original" command, avoiding it to be called with the possible aliases. That is, disables the possible aliases on the command `curl` and adjusts to the original one.
If you have
```
alias grep='grep --color=auto'
```
and then you do `grep`, it will have colours. So if you do not want colour... | It bypasses a possible alias `curl`. |
15,951,772 | looking at the magic installers which appear for all types of projects (e.g. for rvm) you'll always see commands like:
```
\curl ... | bash
```
e.g.
```
\curl -L https://get.rvm.io | bash -s stable
```
And I was wondering why these commands start with a slash - they seem to run fine without it.
Any suggestions? | 2013/04/11 | [
"https://Stackoverflow.com/questions/15951772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116932/"
] | it's a backslash
it is to start the command starting with that name (OR the function) but not the ALIAS.
To make sure to bypass both **function** AND **alias** :
```
command somecommand
```
To bypass **just the alias** (and thus launch a function, or if no function, the command):
```
\somecommand
```
Let's see ... | It bypasses a possible alias `curl`. |
39,068,546 | Is there a rule which states in which order the members of an std::tuple are destroyed?
For example if `Function1` returns an `std::tuple<std::unique_ptr<ClassA>, std::unique_ptr<ClassB>>` to `Function2`, then can I be sure that (when the scope of `Function2` is left) the instance of `ClassB` referred to by the second... | 2016/08/21 | [
"https://Stackoverflow.com/questions/39068546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6306782/"
] | I'll offer a life lesson I've learned, rather than a direct answer, in response to your question:
>
> If you can formulate, for multiple alternatives, a reasonable argument for why that alternative should be the one mandated by the standard - then you should not assume **any** of them is mandated (even if one of them... | With Clang 3.4 I get the same destruction order for both `std::pair` and 2 element `std::tuple` and with g++ 5.3 I get opposite order which could be mainly due to the recursive implementation of `std::tuple` in libstd++.
So, it basically boils down to what I said in the comment, it is implementation defined.
From the... |
39,068,546 | Is there a rule which states in which order the members of an std::tuple are destroyed?
For example if `Function1` returns an `std::tuple<std::unique_ptr<ClassA>, std::unique_ptr<ClassB>>` to `Function2`, then can I be sure that (when the scope of `Function2` is left) the instance of `ClassB` referred to by the second... | 2016/08/21 | [
"https://Stackoverflow.com/questions/39068546",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6306782/"
] | The standard doesn't specify the order of destruction for `std::tuple`. The fact that §20.4.1/p1 specifies that:
>
> An instantiation of tuple with two arguments is similar to an
> instantiation of pair with the same two arguments.
>
>
>
**Similar** here is not interpreted as **identical** and consequently it's ... | With Clang 3.4 I get the same destruction order for both `std::pair` and 2 element `std::tuple` and with g++ 5.3 I get opposite order which could be mainly due to the recursive implementation of `std::tuple` in libstd++.
So, it basically boils down to what I said in the comment, it is implementation defined.
From the... |
71,149,814 | This is my `df`:
```
df = tibble(week = c(1,1,2,2,3,3,3,4,4,4,4),
session = c(1,2,1,2,1,2,3,1,2,3,4),
work =rep("done",11))
df
# A tibble: 11 x 3
week session work
<dbl> <dbl> <chr>
1 1 1 done
2 1 2 done
3 2 1 done
4 2 2 done
5 3 ... | 2022/02/16 | [
"https://Stackoverflow.com/questions/71149814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12452893/"
] | ```
tidyr::complete(df, week, session)
# A tibble: 16 x 3
week session work
<dbl> <dbl> <chr>
1 1 1 done
2 1 2 done
3 1 3 NA
4 1 4 NA
5 2 1 done
6 2 2 done
7 2 3 NA
8 2 4 NA
9 3 1 done
10 3... | Here's a `data.table` solution in case speed is important
```
# load package
library(data.table)
# set as data table
setDT(df)
# cross join to get complete combination
week <- 1:4
session <- 1:4
z <- CJ(week,session)
# join
df_1 <- df[z, on=.(week, session)]
``` |
26,387,776 | There's a few questions that address the async controller workings but none quite deal with what I needed. hopefully someone's already done this and can tell me if I'm doing something wrong.
I've got a combination of a web application that deals with configuring tasks and a console application counterpart that deals w... | 2014/10/15 | [
"https://Stackoverflow.com/questions/26387776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/228638/"
] | >
> *"is there a way to avoid rewriting the body of the second function, by simply calling the first function (maybe doing some kind of cast or something like that)?"*
>
>
>
You can write
```
template<class T>
void foo(T& v) {
foo(&v);
}
```
too pass the pointer to `T&`.
Or the other way round
```
templ... | consider the following code:
```
template<class T>
void foo(T& v)
{
std::cout << v[0] << std::endl;
}
template<class T>
void bar(T* v)
{
foo(*v);
}
void main(void)
{
std::vector<int> vec(5,1);
foo(vec);
bar(&(vec[0]));
}
```
remember that pointers are merely variable which hold an address, so s... |
26,387,776 | There's a few questions that address the async controller workings but none quite deal with what I needed. hopefully someone's already done this and can tell me if I'm doing something wrong.
I've got a combination of a web application that deals with configuring tasks and a console application counterpart that deals w... | 2014/10/15 | [
"https://Stackoverflow.com/questions/26387776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/228638/"
] | I think you created a problem for yourself... if what you want is to have a template function `foo` that can operate on arrays you can just use the base template:
```
template <typename T>
void foo(T & t) {
t[0];
}
int main() {
int array[0] = { 123 };
foo(array);
std::vector<int> v{ 123 };
foo(v);
}
`... | consider the following code:
```
template<class T>
void foo(T& v)
{
std::cout << v[0] << std::endl;
}
template<class T>
void bar(T* v)
{
foo(*v);
}
void main(void)
{
std::vector<int> vec(5,1);
foo(vec);
bar(&(vec[0]));
}
```
remember that pointers are merely variable which hold an address, so s... |
26,387,776 | There's a few questions that address the async controller workings but none quite deal with what I needed. hopefully someone's already done this and can tell me if I'm doing something wrong.
I've got a combination of a web application that deals with configuring tasks and a console application counterpart that deals w... | 2014/10/15 | [
"https://Stackoverflow.com/questions/26387776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/228638/"
] | >
> *"is there a way to avoid rewriting the body of the second function, by simply calling the first function (maybe doing some kind of cast or something like that)?"*
>
>
>
You can write
```
template<class T>
void foo(T& v) {
foo(&v);
}
```
too pass the pointer to `T&`.
Or the other way round
```
templ... | As mentioned in the comments, you can also use the unspecified base template, if you further use a helper for the accessing the parameter:
```
#include <iostream>
template<typename T> T&& call(T&& t) {return std::forward<T>(t);}
template<typename T> T& call(T* t) {return *t;}
template<typename T>
void foo(T&& t)
{
... |
26,387,776 | There's a few questions that address the async controller workings but none quite deal with what I needed. hopefully someone's already done this and can tell me if I'm doing something wrong.
I've got a combination of a web application that deals with configuring tasks and a console application counterpart that deals w... | 2014/10/15 | [
"https://Stackoverflow.com/questions/26387776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/228638/"
] | I think you created a problem for yourself... if what you want is to have a template function `foo` that can operate on arrays you can just use the base template:
```
template <typename T>
void foo(T & t) {
t[0];
}
int main() {
int array[0] = { 123 };
foo(array);
std::vector<int> v{ 123 };
foo(v);
}
`... | As mentioned in the comments, you can also use the unspecified base template, if you further use a helper for the accessing the parameter:
```
#include <iostream>
template<typename T> T&& call(T&& t) {return std::forward<T>(t);}
template<typename T> T& call(T* t) {return *t;}
template<typename T>
void foo(T&& t)
{
... |
24,361,729 | I have the following code snippet:
```
#!/bin/bash
while true; do
ls "$1"
exitstatus=$?
if [[ $exitstatus != 0 ]]; then
read -n 1 -p "Retry? (y/n)" ch
echo
if [[ ! $ch =~ [Yy] ]]; then
break
fi
fi
exit $exitstatus
done
```
Executing this scr... | 2014/06/23 | [
"https://Stackoverflow.com/questions/24361729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | `exit $exitstatus` exits the loop after the first try. It should be outside the loop. | You have several logic problems:
(1) You asked for retry, but if the answer was y, you never read in a new filename to test against, so it would always fail.
(2) also glaring was when you asked for a retry, you then did this: You got a Y on retry, but then just dumped the user into `break` and you went nowhere furthe... |
11,891,455 | Before I start, I need to stress the fact that I have looked at every post dealing with the documents directory.
So I will try to disect my problem to better help you help me.
I am developing an iOS application targeted for 5.1. I am using XCode 4.4.1 and the iOS simulator Version 5.1 (272.21).
It is in my understa... | 2012/08/09 | [
"https://Stackoverflow.com/questions/11891455",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/162059/"
] | See <http://code.google.com/p/android-wheel/>
You might be able to adapt it for your needs. | Here's code provided by a previous user:
```
private Handler mHandler = new Handler();
OnClickListener mStartListener = new OnClickListener()
{
public void onClick(View v)
{
if (mStartTime == 0L)
{
mStartTime = System.currentTimeMillis();
mHandler.removeCallbacks(mUpdateTim... |
5,248,855 | I have this code if in my parameters I use like '123' and nothing for the second one then I get every row returned because its matching the wilcards in the address2 with every row since its blank. Now how do I stop this from happening?
```
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Addres... | 2011/03/09 | [
"https://Stackoverflow.com/questions/5248855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/595208/"
] | Empty string will cause the results to come back, but null will not.
```
if ( @add2 = '' )
begin
set @add2 = null
end
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Address1 LIKE '%' + @add1 + '%') OR
(Address2 LIKE '%' + @add2 + '%')
``` | You can use a `REPLACE` function on top of `'%' + @add2 + '%'` (and for `@add1` probably) to replace `%%` with `''` or anything else that will return nothing.
For example:
```
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Address1 LIKE REPLACE('%' + @add1 + '%','%%', 'VoidInput')) OR
... |
5,248,855 | I have this code if in my parameters I use like '123' and nothing for the second one then I get every row returned because its matching the wilcards in the address2 with every row since its blank. Now how do I stop this from happening?
```
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Addres... | 2011/03/09 | [
"https://Stackoverflow.com/questions/5248855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/595208/"
] | You can use [nullif](http://msdn.microsoft.com/en-us/library/ms177562.aspx). If the parameters to nullif is equal the result will be null and `like null` will not give any hits.
```
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Address1 LIKE '%' + nullif(@add1, '') + '%') OR
(Address2 LIKE '%' + nulli... | You can use a `REPLACE` function on top of `'%' + @add2 + '%'` (and for `@add1` probably) to replace `%%` with `''` or anything else that will return nothing.
For example:
```
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Address1 LIKE REPLACE('%' + @add1 + '%','%%', 'VoidInput')) OR
... |
5,248,855 | I have this code if in my parameters I use like '123' and nothing for the second one then I get every row returned because its matching the wilcards in the address2 with every row since its blank. Now how do I stop this from happening?
```
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Addres... | 2011/03/09 | [
"https://Stackoverflow.com/questions/5248855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/595208/"
] | Empty string will cause the results to come back, but null will not.
```
if ( @add2 = '' )
begin
set @add2 = null
end
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Address1 LIKE '%' + @add1 + '%') OR
(Address2 LIKE '%' + @add2 + '%')
``` | When @add2 is blank, it will be a positive match for everything in Address2.
Try this:
```
SELECT AddressID, Address1, Address2
FROM Address
WHERE ((@add1 <> '' and Address1 LIKE '%' + @add1 + '%')
OR (@add2 <> '' and Address2 LIKE '%' + @add2 + '%'))
``` |
5,248,855 | I have this code if in my parameters I use like '123' and nothing for the second one then I get every row returned because its matching the wilcards in the address2 with every row since its blank. Now how do I stop this from happening?
```
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Addres... | 2011/03/09 | [
"https://Stackoverflow.com/questions/5248855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/595208/"
] | You can use [nullif](http://msdn.microsoft.com/en-us/library/ms177562.aspx). If the parameters to nullif is equal the result will be null and `like null` will not give any hits.
```
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Address1 LIKE '%' + nullif(@add1, '') + '%') OR
(Address2 LIKE '%' + nulli... | When @add2 is blank, it will be a positive match for everything in Address2.
Try this:
```
SELECT AddressID, Address1, Address2
FROM Address
WHERE ((@add1 <> '' and Address1 LIKE '%' + @add1 + '%')
OR (@add2 <> '' and Address2 LIKE '%' + @add2 + '%'))
``` |
5,248,855 | I have this code if in my parameters I use like '123' and nothing for the second one then I get every row returned because its matching the wilcards in the address2 with every row since its blank. Now how do I stop this from happening?
```
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Addres... | 2011/03/09 | [
"https://Stackoverflow.com/questions/5248855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/595208/"
] | You can use [nullif](http://msdn.microsoft.com/en-us/library/ms177562.aspx). If the parameters to nullif is equal the result will be null and `like null` will not give any hits.
```
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Address1 LIKE '%' + nullif(@add1, '') + '%') OR
(Address2 LIKE '%' + nulli... | Empty string will cause the results to come back, but null will not.
```
if ( @add2 = '' )
begin
set @add2 = null
end
SELECT AddressID, Address1, Address2
FROM Address
WHERE (Address1 LIKE '%' + @add1 + '%') OR
(Address2 LIKE '%' + @add2 + '%')
``` |
51,482 | "I go up and down. I see shots each day."
The answer must be able to be found within a school environment.
Thank you!! | 2017/05/03 | [
"https://puzzling.stackexchange.com/questions/51482",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/36399/"
] | I think the answer is:
>
> A tennis ball or cricket ball
>
>
>
This is because:
>
> When a tennis ball or cricket ball is hit it is called a shot
>
>
> | From @Sosig answer, I think the better answer is :
>
> **Ball**
>
> Futsal Ball, Tennis Ball, Soccer Ball, Volley Ball etc
>
> You shoot the balls, the balls are go up and down, and balls are played at school.
>
>
> |
51,482 | "I go up and down. I see shots each day."
The answer must be able to be found within a school environment.
Thank you!! | 2017/05/03 | [
"https://puzzling.stackexchange.com/questions/51482",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/36399/"
] | I think the answer is:
>
> A tennis ball or cricket ball
>
>
>
This is because:
>
> When a tennis ball or cricket ball is hit it is called a shot
>
>
> | My guess:
>
> Gymnasium scoreboard
>
>
>
Because:
>
> Scores go up, while the time winds down. Shots is obvious.
>
>
> |
51,482 | "I go up and down. I see shots each day."
The answer must be able to be found within a school environment.
Thank you!! | 2017/05/03 | [
"https://puzzling.stackexchange.com/questions/51482",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/36399/"
] | I think the answer is:
>
> A tennis ball or cricket ball
>
>
>
This is because:
>
> When a tennis ball or cricket ball is hit it is called a shot
>
>
> | I suspect the answer is actually:
>
> **A basketball hoop**
>
>
>
"I go up and down."
>
> Basketball hoops can be adjusted for height.
>
> They can also be raised up out of the way when not needed, or lowered into position for use.
>
>
>
"I see shots each day."
>
> Throwing the basketball at the ho... |
51,482 | "I go up and down. I see shots each day."
The answer must be able to be found within a school environment.
Thank you!! | 2017/05/03 | [
"https://puzzling.stackexchange.com/questions/51482",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/36399/"
] | From @Sosig answer, I think the better answer is :
>
> **Ball**
>
> Futsal Ball, Tennis Ball, Soccer Ball, Volley Ball etc
>
> You shoot the balls, the balls are go up and down, and balls are played at school.
>
>
> | My guess:
>
> Gymnasium scoreboard
>
>
>
Because:
>
> Scores go up, while the time winds down. Shots is obvious.
>
>
> |
51,482 | "I go up and down. I see shots each day."
The answer must be able to be found within a school environment.
Thank you!! | 2017/05/03 | [
"https://puzzling.stackexchange.com/questions/51482",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/36399/"
] | From @Sosig answer, I think the better answer is :
>
> **Ball**
>
> Futsal Ball, Tennis Ball, Soccer Ball, Volley Ball etc
>
> You shoot the balls, the balls are go up and down, and balls are played at school.
>
>
> | I suspect the answer is actually:
>
> **A basketball hoop**
>
>
>
"I go up and down."
>
> Basketball hoops can be adjusted for height.
>
> They can also be raised up out of the way when not needed, or lowered into position for use.
>
>
>
"I see shots each day."
>
> Throwing the basketball at the ho... |
21,805,026 | I would like to add a document if it does not exist and else add an element to one of it's sub-documents.
```
db.test.update(
{
name : 'Peter'
},
$setOnInsert : {
name : 'Peter',
visits: { 'en' : ['today'], 'us' : [] }
},
$push : {
visits.en : 'today'
},
{ upsert : true }
)
```
... | 2014/02/15 | [
"https://Stackoverflow.com/questions/21805026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1155090/"
] | You could implement it without `$setOnInsert` operator.
```
db.test.update(
{
name : 'Peter'
},
{
$push : {
"visits.en" : 'today'
}
},
{ upsert : true }
)
```
If Peter exists, element `'today'` will be added to its `visits.en` array. Else, will be created a document for Peter, with `visi... | You can still use `$setOnInsert` but when `$setOnInsert` and `$push` doesn't updates in the same fields as mentioned before.
**N.b:** We use `$addToSet` if you don't want a duplicated values in your Array
```
db.test.update(
{
name : 'Peter'
},
{
$setOnInsert: {name : 'Peter'},
$addToS... |
18,124,337 | So I have an IBAction hooked up to multiple buttons in IB I want this action to be fired when another IBAction is called I also want it to recognise an int from the second action as the [sender tag].
// viewController.m
```
-(IBAction)buttonPress {
int getInter = [sender tag];
UIView *tmpView = [self.view viewW... | 2013/08/08 | [
"https://Stackoverflow.com/questions/18124337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2664072/"
] | ```
UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(10, 10, 20, 20)];
[btn1 setTitle:@"Button 1" forState:UIControlStateNormal];
btn1.tag = 1;
[btn1 addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn1];
UIButton *btn2 = [[UIButton alloc] i... | Just set the tag in initWithNibName method. Follow the sample and see whether it is helpful for you!!
```
@property(nonatomic,strong)IBOutlet UIButton *btn1;
@property(nonatomic,strong)IBOutlet UIButton *btn2;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWit... |
18,124,337 | So I have an IBAction hooked up to multiple buttons in IB I want this action to be fired when another IBAction is called I also want it to recognise an int from the second action as the [sender tag].
// viewController.m
```
-(IBAction)buttonPress {
int getInter = [sender tag];
UIView *tmpView = [self.view viewW... | 2013/08/08 | [
"https://Stackoverflow.com/questions/18124337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2664072/"
] | I ended up hooking it up to the same IBAction and running an if statement to do something if that tag was called.
Seems simple now!
```
-(IBAction)buttonPress {
int getInter = [sender tag];
if ([sender tag] == 2) {
//Do something just for that button.
}
else
{
UIView *tmpView = [self.view v... | ```
UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(10, 10, 20, 20)];
[btn1 setTitle:@"Button 1" forState:UIControlStateNormal];
btn1.tag = 1;
[btn1 addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn1];
UIButton *btn2 = [[UIButton alloc] i... |
18,124,337 | So I have an IBAction hooked up to multiple buttons in IB I want this action to be fired when another IBAction is called I also want it to recognise an int from the second action as the [sender tag].
// viewController.m
```
-(IBAction)buttonPress {
int getInter = [sender tag];
UIView *tmpView = [self.view viewW... | 2013/08/08 | [
"https://Stackoverflow.com/questions/18124337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2664072/"
] | I ended up hooking it up to the same IBAction and running an if statement to do something if that tag was called.
Seems simple now!
```
-(IBAction)buttonPress {
int getInter = [sender tag];
if ([sender tag] == 2) {
//Do something just for that button.
}
else
{
UIView *tmpView = [self.view v... | Just set the tag in initWithNibName method. Follow the sample and see whether it is helpful for you!!
```
@property(nonatomic,strong)IBOutlet UIButton *btn1;
@property(nonatomic,strong)IBOutlet UIButton *btn2;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWit... |
12,193,715 | I'm very new to JS and have a problem with something that looks very simple.
I am trying to make a code so that if the page loads with a # at the end of the url, eg. www.example.com#hashtag, then a div will display, if it doesn't have a # the div wont display.
My Code:
JS:
```
<script type="text/javascript">
if(wind... | 2012/08/30 | [
"https://Stackoverflow.com/questions/12193715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1635541/"
] | The code is correct, but the `<script>` is executing too early, *before* the `<div>` is rendered, so I suspect you are getting a JavaScript error in the browser. Did you check the browser console?
Moving the `<script>` *after* the `<div>` will fix it but it might be wise to put the code into a function and call it aft... | This will get the Hash (#displayDiv) and show that particular div...
```
<script type="text/javascript">
var hasher = window.location.hash;
if(hasher.indexOf('displaydiv') > -1) {
document.getElementById("displaydiv").style.display = "block";
} else if (hasher.indexOf('anotherDiv') > -1) {
document.get... |
12,193,715 | I'm very new to JS and have a problem with something that looks very simple.
I am trying to make a code so that if the page loads with a # at the end of the url, eg. www.example.com#hashtag, then a div will display, if it doesn't have a # the div wont display.
My Code:
JS:
```
<script type="text/javascript">
if(wind... | 2012/08/30 | [
"https://Stackoverflow.com/questions/12193715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1635541/"
] | The code is correct, but the `<script>` is executing too early, *before* the `<div>` is rendered, so I suspect you are getting a JavaScript error in the browser. Did you check the browser console?
Moving the `<script>` *after* the `<div>` will fix it but it might be wise to put the code into a function and call it aft... | How about a simple CSS solution using the [:target](http://www.w3.org/TR/selectors/#target-pseudo) selector:
```
*:target {
display: block;
}
``` |
245,396 | I'm not sure "opposite" is the correct word, but I am searching for a word that is about remembering something unpleasant.
When I searched the Internet for an opposte of "to reminisce", I only found words about not remembering, and not about remembering something unpleasant. | 2015/05/10 | [
"https://english.stackexchange.com/questions/245396",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/31457/"
] | **ruminate**
>
> **Rumination (psychology)**
>
>
> Rumination is the compulsively focused attention on the symptoms of
> one's distress, and on its possible causes and consequences, as
> opposed to its solutions. Rumination is similar to worry except
> rumination focuses on bad feelings and experiences from the pas... | The best I can come up with off the top of my head is to re-experience and the description of the experience would clarify the negative connotation.
Example: "My father smalled the rain and began to scan the sky, it was as if he were re-experiencing the jungles of Viet Nam."
Source:[Re-experiencing symptoms are a spe... |
245,396 | I'm not sure "opposite" is the correct word, but I am searching for a word that is about remembering something unpleasant.
When I searched the Internet for an opposte of "to reminisce", I only found words about not remembering, and not about remembering something unpleasant. | 2015/05/10 | [
"https://english.stackexchange.com/questions/245396",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/31457/"
] | Would *flashback* be the word? It's maybe not specific enough, but certainly in connection with, say *acid flashback* it has unpleasant connotations.
>
> **flashback** *noun*
> 1.1 A disturbing sudden vivid memory of an event in the past, typically as the result of psychological trauma or taking LSD.
> ‘The drinkin... | To dwell on something means to keep one's self on the past, not to think about the past periodically, while to ruminate is as good as bringing the past to present through thoughts. I'll put it as: "she keeps dwelling and ruminating the traumatic experience of her time with her first husband".
Hope this works.. |
245,396 | I'm not sure "opposite" is the correct word, but I am searching for a word that is about remembering something unpleasant.
When I searched the Internet for an opposte of "to reminisce", I only found words about not remembering, and not about remembering something unpleasant. | 2015/05/10 | [
"https://english.stackexchange.com/questions/245396",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/31457/"
] | Would *flashback* be the word? It's maybe not specific enough, but certainly in connection with, say *acid flashback* it has unpleasant connotations.
>
> **flashback** *noun*
> 1.1 A disturbing sudden vivid memory of an event in the past, typically as the result of psychological trauma or taking LSD.
> ‘The drinkin... | The best I can come up with off the top of my head is to re-experience and the description of the experience would clarify the negative connotation.
Example: "My father smalled the rain and began to scan the sky, it was as if he were re-experiencing the jungles of Viet Nam."
Source:[Re-experiencing symptoms are a spe... |
245,396 | I'm not sure "opposite" is the correct word, but I am searching for a word that is about remembering something unpleasant.
When I searched the Internet for an opposte of "to reminisce", I only found words about not remembering, and not about remembering something unpleasant. | 2015/05/10 | [
"https://english.stackexchange.com/questions/245396",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/31457/"
] | I would add "lament" to this list as it deals with mourning and grief.
A lament or lamentation is a passionate expression of grief, often in music, poetry, or song form. The grief is most often born of regret, or mourning. Laments can also be expressed in a verbal manner, where the participant would lament about somet... | The best I can come up with off the top of my head is to re-experience and the description of the experience would clarify the negative connotation.
Example: "My father smalled the rain and began to scan the sky, it was as if he were re-experiencing the jungles of Viet Nam."
Source:[Re-experiencing symptoms are a spe... |
245,396 | I'm not sure "opposite" is the correct word, but I am searching for a word that is about remembering something unpleasant.
When I searched the Internet for an opposte of "to reminisce", I only found words about not remembering, and not about remembering something unpleasant. | 2015/05/10 | [
"https://english.stackexchange.com/questions/245396",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/31457/"
] | >
> **dwell on/upon**
>
>
> *verb (past and past participle dwelt or dwelled)*
>
>
> 2 (dwell on/upon) Think, speak, or write at length about (a particular
> subject, especially one that is a source of unhappiness, anxiety, or
> dissatisfaction):
> *I’ve got better things to do than **dwell on** the past*
> [... | The best I can come up with off the top of my head is to re-experience and the description of the experience would clarify the negative connotation.
Example: "My father smalled the rain and began to scan the sky, it was as if he were re-experiencing the jungles of Viet Nam."
Source:[Re-experiencing symptoms are a spe... |
245,396 | I'm not sure "opposite" is the correct word, but I am searching for a word that is about remembering something unpleasant.
When I searched the Internet for an opposte of "to reminisce", I only found words about not remembering, and not about remembering something unpleasant. | 2015/05/10 | [
"https://english.stackexchange.com/questions/245396",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/31457/"
] | I would add "lament" to this list as it deals with mourning and grief.
A lament or lamentation is a passionate expression of grief, often in music, poetry, or song form. The grief is most often born of regret, or mourning. Laments can also be expressed in a verbal manner, where the participant would lament about somet... | To dwell on something means to keep one's self on the past, not to think about the past periodically, while to ruminate is as good as bringing the past to present through thoughts. I'll put it as: "she keeps dwelling and ruminating the traumatic experience of her time with her first husband".
Hope this works.. |
245,396 | I'm not sure "opposite" is the correct word, but I am searching for a word that is about remembering something unpleasant.
When I searched the Internet for an opposte of "to reminisce", I only found words about not remembering, and not about remembering something unpleasant. | 2015/05/10 | [
"https://english.stackexchange.com/questions/245396",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/31457/"
] | **ruminate**
>
> **Rumination (psychology)**
>
>
> Rumination is the compulsively focused attention on the symptoms of
> one's distress, and on its possible causes and consequences, as
> opposed to its solutions. Rumination is similar to worry except
> rumination focuses on bad feelings and experiences from the pas... | To dwell on something means to keep one's self on the past, not to think about the past periodically, while to ruminate is as good as bringing the past to present through thoughts. I'll put it as: "she keeps dwelling and ruminating the traumatic experience of her time with her first husband".
Hope this works.. |
245,396 | I'm not sure "opposite" is the correct word, but I am searching for a word that is about remembering something unpleasant.
When I searched the Internet for an opposte of "to reminisce", I only found words about not remembering, and not about remembering something unpleasant. | 2015/05/10 | [
"https://english.stackexchange.com/questions/245396",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/31457/"
] | **ruminate**
>
> **Rumination (psychology)**
>
>
> Rumination is the compulsively focused attention on the symptoms of
> one's distress, and on its possible causes and consequences, as
> opposed to its solutions. Rumination is similar to worry except
> rumination focuses on bad feelings and experiences from the pas... | If you can't get something unpleasant out of your head, you would **agonize** over it.
>
> [agonize](http://www.merriam-webster.com/dictionary/agonize) (verb) - to think or worry very much about something; to cause to suffer agony
>
>
> |
245,396 | I'm not sure "opposite" is the correct word, but I am searching for a word that is about remembering something unpleasant.
When I searched the Internet for an opposte of "to reminisce", I only found words about not remembering, and not about remembering something unpleasant. | 2015/05/10 | [
"https://english.stackexchange.com/questions/245396",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/31457/"
] | **ruminate**
>
> **Rumination (psychology)**
>
>
> Rumination is the compulsively focused attention on the symptoms of
> one's distress, and on its possible causes and consequences, as
> opposed to its solutions. Rumination is similar to worry except
> rumination focuses on bad feelings and experiences from the pas... | Would *flashback* be the word? It's maybe not specific enough, but certainly in connection with, say *acid flashback* it has unpleasant connotations.
>
> **flashback** *noun*
> 1.1 A disturbing sudden vivid memory of an event in the past, typically as the result of psychological trauma or taking LSD.
> ‘The drinkin... |
245,396 | I'm not sure "opposite" is the correct word, but I am searching for a word that is about remembering something unpleasant.
When I searched the Internet for an opposte of "to reminisce", I only found words about not remembering, and not about remembering something unpleasant. | 2015/05/10 | [
"https://english.stackexchange.com/questions/245396",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/31457/"
] | If you can't get something unpleasant out of your head, you would **agonize** over it.
>
> [agonize](http://www.merriam-webster.com/dictionary/agonize) (verb) - to think or worry very much about something; to cause to suffer agony
>
>
> | The best I can come up with off the top of my head is to re-experience and the description of the experience would clarify the negative connotation.
Example: "My father smalled the rain and began to scan the sky, it was as if he were re-experiencing the jungles of Viet Nam."
Source:[Re-experiencing symptoms are a spe... |
3,165,289 | I am not new to c++,but i have not found a c++ desktop applications framework.I have found one and it seems to complex.Are there other frameworks available for c++ out there?. | 2010/07/02 | [
"https://Stackoverflow.com/questions/3165289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/492293/"
] | Qt - forever! It is mature and cross-platform.
<http://en.wikipedia.org/wiki/Qt_(framework)> | There's [wxWidgets](http://www.wxwidgets.org) and [Qt](http://qt.nokia.com/products/), both Open Source and free. Qt became very popular recently.
Also, you might want to look at [C++ Builder](http://www.embarcadero.com/products/cbuilder), which allows you to build C++ applications in a VB-like way using a component ... |
3,165,289 | I am not new to c++,but i have not found a c++ desktop applications framework.I have found one and it seems to complex.Are there other frameworks available for c++ out there?. | 2010/07/02 | [
"https://Stackoverflow.com/questions/3165289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/492293/"
] | There are various choices when it comes to c++ Desktop app frameworks,
it mainy depends on your skills and on the plattform you want the app to run.
Two Opensource Frameworks that are plattform independent, I have used so far are
The [QT-Framework](http://qt.nokia.com/products/) from trolltech now nokia and [wxWidge... | There's [wxWidgets](http://www.wxwidgets.org) and [Qt](http://qt.nokia.com/products/), both Open Source and free. Qt became very popular recently.
Also, you might want to look at [C++ Builder](http://www.embarcadero.com/products/cbuilder), which allows you to build C++ applications in a VB-like way using a component ... |
3,165,289 | I am not new to c++,but i have not found a c++ desktop applications framework.I have found one and it seems to complex.Are there other frameworks available for c++ out there?. | 2010/07/02 | [
"https://Stackoverflow.com/questions/3165289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/492293/"
] | Qt - forever! It is mature and cross-platform.
<http://en.wikipedia.org/wiki/Qt_(framework)> | A great framework is [Qt](http://en.wikipedia.org/wiki/Qt_(framework)). |
3,165,289 | I am not new to c++,but i have not found a c++ desktop applications framework.I have found one and it seems to complex.Are there other frameworks available for c++ out there?. | 2010/07/02 | [
"https://Stackoverflow.com/questions/3165289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/492293/"
] | There are various choices when it comes to c++ Desktop app frameworks,
it mainy depends on your skills and on the plattform you want the app to run.
Two Opensource Frameworks that are plattform independent, I have used so far are
The [QT-Framework](http://qt.nokia.com/products/) from trolltech now nokia and [wxWidge... | A great framework is [Qt](http://en.wikipedia.org/wiki/Qt_(framework)). |
3,165,289 | I am not new to c++,but i have not found a c++ desktop applications framework.I have found one and it seems to complex.Are there other frameworks available for c++ out there?. | 2010/07/02 | [
"https://Stackoverflow.com/questions/3165289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/492293/"
] | There are various choices when it comes to c++ Desktop app frameworks,
it mainy depends on your skills and on the plattform you want the app to run.
Two Opensource Frameworks that are plattform independent, I have used so far are
The [QT-Framework](http://qt.nokia.com/products/) from trolltech now nokia and [wxWidge... | Qt - forever! It is mature and cross-platform.
<http://en.wikipedia.org/wiki/Qt_(framework)> |
11,197,220 | Here is my problem: <http://testepi.kvalitne.cz/test/>
I do not want the delay between a keypress and the movement of the square. I would also like to know how to move diagonally (pressing two keys at same time).
My code:
```
$(function(){
document.addEventListener("keydown", move, false);
var x = 0;
var y = 0;
... | 2012/06/25 | [
"https://Stackoverflow.com/questions/11197220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1327484/"
] | First, to avoid the keypress/repeat delay, you have to wrap your program in a loop, and make the state of the keyboard available inside the scope of that loop, secondly to monitor multiple keypresses you need to keep track of individual keydown and keyup events:
```
var x = 0;
var y = 0;
// store the current pressed ... | If you are trying to implement game-like 2d sprite movement, I suggest you have a notion of x and y velocity, rather than moving the sprite a fixed amount on keypress.
So on keypress, add or subtract from x or y velocity.
```
var xvel = 0,
yvel = 0,
x = 0,
y = 0;
setInterval(function () {
... |
11,197,220 | Here is my problem: <http://testepi.kvalitne.cz/test/>
I do not want the delay between a keypress and the movement of the square. I would also like to know how to move diagonally (pressing two keys at same time).
My code:
```
$(function(){
document.addEventListener("keydown", move, false);
var x = 0;
var y = 0;
... | 2012/06/25 | [
"https://Stackoverflow.com/questions/11197220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1327484/"
] | First, to avoid the keypress/repeat delay, you have to wrap your program in a loop, and make the state of the keyboard available inside the scope of that loop, secondly to monitor multiple keypresses you need to keep track of individual keydown and keyup events:
```
var x = 0;
var y = 0;
// store the current pressed ... | have you looked [here](https://developer.mozilla.org/en/DOM/KeyboardEvent)? you should be able to do diagonal moving by checking if multiple keys have been pressed down without being released. |
11,197,220 | Here is my problem: <http://testepi.kvalitne.cz/test/>
I do not want the delay between a keypress and the movement of the square. I would also like to know how to move diagonally (pressing two keys at same time).
My code:
```
$(function(){
document.addEventListener("keydown", move, false);
var x = 0;
var y = 0;
... | 2012/06/25 | [
"https://Stackoverflow.com/questions/11197220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1327484/"
] | If you are trying to implement game-like 2d sprite movement, I suggest you have a notion of x and y velocity, rather than moving the sprite a fixed amount on keypress.
So on keypress, add or subtract from x or y velocity.
```
var xvel = 0,
yvel = 0,
x = 0,
y = 0;
setInterval(function () {
... | have you looked [here](https://developer.mozilla.org/en/DOM/KeyboardEvent)? you should be able to do diagonal moving by checking if multiple keys have been pressed down without being released. |
19,487,095 | What I am looking for is slightly subjective, but I am sure there is a better way to do this.
I am looking for a better way to perform javascript while a user is typing content into either a textarea or input box on a website. For instance, sites such as Google Docs are capable of saving changes to documents almost in... | 2013/10/21 | [
"https://Stackoverflow.com/questions/19487095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/565534/"
] | There is a [jQuery plugin](http://benalman.com/projects/jquery-throttle-debounce-plugin/) that does pretty much what you did.
Your example will be transformed into
```
$("#element").on("keyup", $.debounce(1000, function() { /* Do something */ }));
```
The code will execute after a user is not pressing any keys for 1... | I have found a very good solution for this. This code will check whether the content has been changed and based on that it will save it otherwise the save functionality will not be executed !
Check out this demo [**JSFIDDLE**](http://jsfiddle.net/phpdeveloperrahul/v5G9k/3/)
Here is the code :
HTML :
```
Content:<... |
19,487,095 | What I am looking for is slightly subjective, but I am sure there is a better way to do this.
I am looking for a better way to perform javascript while a user is typing content into either a textarea or input box on a website. For instance, sites such as Google Docs are capable of saving changes to documents almost in... | 2013/10/21 | [
"https://Stackoverflow.com/questions/19487095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/565534/"
] | There is a [jQuery plugin](http://benalman.com/projects/jquery-throttle-debounce-plugin/) that does pretty much what you did.
Your example will be transformed into
```
$("#element").on("keyup", $.debounce(1000, function() { /* Do something */ }));
```
The code will execute after a user is not pressing any keys for 1... | You can make your own little delay by using the window.setTimeout-Function:
```
var IntervalId = null;
function saveEdits(){
//Doing your savings...
}
$('input').keyup(function(){
if (IntervalId){
window.clearTimeout(IntervalId);
IntervalId = null;
}
IntervalId = window.setTimeout(fu... |
16,965,855 | Random Code:
```
// Getting All Contacts
public List<Contact> getAllContacts() {
List<Contact> contactList = new ArrayList<Contact>();
// Select All Query
String selectQuery = "SELECT * FROM " + TABLE_CONTACTS;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuer... | 2013/06/06 | [
"https://Stackoverflow.com/questions/16965855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2429326/"
] | It's called [Generics](http://docs.oracle.com/javase/tutorial/extra/generics/intro.html), introduced since JDK 5. Java `List` has been Generi-fied to allow developers to specify a type (called parameterized type). This essentially can be translated as a "List of Contact". You can add `Contact` into the list and retriev... | That is what is called a 'generic'. In this code it means "List of type Contact" Here is a question where it is answered well: [Java Generics: List, List<Object>, List<?>](https://stackoverflow.com/questions/490091/java-generics) |
16,965,855 | Random Code:
```
// Getting All Contacts
public List<Contact> getAllContacts() {
List<Contact> contactList = new ArrayList<Contact>();
// Select All Query
String selectQuery = "SELECT * FROM " + TABLE_CONTACTS;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuer... | 2013/06/06 | [
"https://Stackoverflow.com/questions/16965855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2429326/"
] | It doesn't need the class `Contact` inside of the return type. In fact in the old version of java, pre JDK 5, this was the only way to write the method.
```
public List getAllContacts() {...}
```
The problem with this is you don't know what type of Class the List contains, [Generics](http://docs.oracle.com/javase/tu... | It's called [Generics](http://docs.oracle.com/javase/tutorial/extra/generics/intro.html), introduced since JDK 5. Java `List` has been Generi-fied to allow developers to specify a type (called parameterized type). This essentially can be translated as a "List of Contact". You can add `Contact` into the list and retriev... |
16,965,855 | Random Code:
```
// Getting All Contacts
public List<Contact> getAllContacts() {
List<Contact> contactList = new ArrayList<Contact>();
// Select All Query
String selectQuery = "SELECT * FROM " + TABLE_CONTACTS;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuer... | 2013/06/06 | [
"https://Stackoverflow.com/questions/16965855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2429326/"
] | It's not a tag, it's creating an instance of a generic type specialized to the appropriate type. `List<>` is a generic list; it can contain anything. `List<Contact>` is a list where the elements in the list are instances of the `Contact` class.
See <http://docs.oracle.com/javase/tutorial/extra/generics/intro.html> | That is what is called a 'generic'. In this code it means "List of type Contact" Here is a question where it is answered well: [Java Generics: List, List<Object>, List<?>](https://stackoverflow.com/questions/490091/java-generics) |
16,965,855 | Random Code:
```
// Getting All Contacts
public List<Contact> getAllContacts() {
List<Contact> contactList = new ArrayList<Contact>();
// Select All Query
String selectQuery = "SELECT * FROM " + TABLE_CONTACTS;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuer... | 2013/06/06 | [
"https://Stackoverflow.com/questions/16965855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2429326/"
] | It doesn't need the class `Contact` inside of the return type. In fact in the old version of java, pre JDK 5, this was the only way to write the method.
```
public List getAllContacts() {...}
```
The problem with this is you don't know what type of Class the List contains, [Generics](http://docs.oracle.com/javase/tu... | It's not a tag, it's creating an instance of a generic type specialized to the appropriate type. `List<>` is a generic list; it can contain anything. `List<Contact>` is a list where the elements in the list are instances of the `Contact` class.
See <http://docs.oracle.com/javase/tutorial/extra/generics/intro.html> |
16,965,855 | Random Code:
```
// Getting All Contacts
public List<Contact> getAllContacts() {
List<Contact> contactList = new ArrayList<Contact>();
// Select All Query
String selectQuery = "SELECT * FROM " + TABLE_CONTACTS;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuer... | 2013/06/06 | [
"https://Stackoverflow.com/questions/16965855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2429326/"
] | It doesn't need the class `Contact` inside of the return type. In fact in the old version of java, pre JDK 5, this was the only way to write the method.
```
public List getAllContacts() {...}
```
The problem with this is you don't know what type of Class the List contains, [Generics](http://docs.oracle.com/javase/tu... | That is what is called a 'generic'. In this code it means "List of type Contact" Here is a question where it is answered well: [Java Generics: List, List<Object>, List<?>](https://stackoverflow.com/questions/490091/java-generics) |
2,911,805 | According to *Differential Geometry* by Pressley:
>
> $\mathsf{Proposition}\:\mathsf{1.3}$
>
>
> *Any reparametrisation of a regular curve is regular.*
>
>
>
>
>
>
> *Proof* $\it{1.3}$
>
>
> Suppose that $\gamma$ and $\tilde{\gamma}$ are related as in Definition 1.5, let $t=\phi(\tilde{t})$, and let $... | 2018/09/10 | [
"https://math.stackexchange.com/questions/2911805",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | No, you are not right. All cosets have the same number of elements. So, if $\Sigma$ only has a single element, all other cosets have a single element too and that can only happen if $H=\{0\}$. But we are assuming that $H$ is a non-trivial subgroup.
**Hint:** The answer is $a=1$. Can you prove it? | Here are the intermediate steps I would do to get through your problem:
1. How many elements does $H$ have?
2. Which subgroups of $G$ have that many elements?
3. For each of those subgroups, what are all its cosets?
4. Which of those cosets contain $5$?
5. What other elements are together with $5$ in any of those cose... |
33,096,276 | I was trying to dockerize a nodejs application. I am adding code files to container using ADD command in Dockerfile. But i just noticed that folders named branches, objects, config, hooks are created automatically. Anybody out there know if its docker? | 2015/10/13 | [
"https://Stackoverflow.com/questions/33096276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1096247/"
] | Found the issue. Using ADD ./\* ./folder name/ instead of ADD . ./folder name created the extra folders.
But still wonder where those folders came from. | If your code file is in a git repo, you would have a .git subfolder that could be included by your ADD command.
That would explain the branches, hooks, ... folders.
As mentioned in "[How to ADD all files/directories except hidden directory like .git in Dockerfile](https://stackoverflow.com/a/28083499/6309)", you can ... |
182,749 | If I have some strings eg:
```
str1 = "12-26b-14a";
str2 = "12-21h-14";
```
and I want to replace the string with a value based on the following rules:
```
testru = {"12-26b" -> xx, "12-21h" -> yy, "12-42e" -> zz};
```
I can make the following criteria:
```
DeleteCases[
ReplaceAll[If[StringMatchQ[s... | 2018/09/28 | [
"https://mathematica.stackexchange.com/questions/182749",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/4626/"
] | Maybe something like:
```
Replace[
{str1, str2},
{_?(StringStartsQ["12-26b"])->xx, _?(StringStartsQ["12-21h"])->yy},
{1}
]
```
>
> {xx, yy}
>
>
>
**Addendum to address OP edits**
If you need to use `testru` as is, then you could do something like:
```
Replace[
{str1, str2},
Replace[testru,... | ```
rule = MapAt[_String?(StringStartsQ[#]) &, testru, {All, 1}]
Replace[ {str1, str2}, rule, All]
```
>
> {xx, yy}
>
>
>
```
{str1, str2} /. rule
```
>
> {xx, yy}
>
>
>
Also
```
srule = # ~~ ___ -> #2 & @@@ testru;
# & @@@ StringReplace[srule] @ {str1, str2}
```
>
> {xx, yy}
>
>
> |
46,178,114 | I'm receiving following error message when trying to debug a project on Eclipse Oxygen5:
[](https://i.stack.imgur.com/SnAts.png)
This Eclipse installation was made on a new machine along with JDK1.8.0\_144 and JRE1.8.0\_144. I then copied the workspace folde... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46178114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8597978/"
] | I had the same problem. After investigating, I've found that removing my debug configurations fixes the problem. So, in your debug config, remove
`Xrunjdwp:transport=dt_socket,suspend=n,address=8000,server=y` | Deleting and re-importing project in the eclipse worked for me. |
46,178,114 | I'm receiving following error message when trying to debug a project on Eclipse Oxygen5:
[](https://i.stack.imgur.com/SnAts.png)
This Eclipse installation was made on a new machine along with JDK1.8.0\_144 and JRE1.8.0\_144. I then copied the workspace folde... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46178114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8597978/"
] | I got a similar error because i had set the initial size of the heap grater than the maximal amount assigned (on a jboss server).
>
> -server -Xms2048m -Xmx1024m
> to
> -server **-Xms2048m -Xmx2048m**
>
>
> | In Brazil Warsaw cause this error on eclipse.
You can uninstall Warsaw from your computer by using the Add/Remove Program feature in the Window's Control Panel.
This solved my problem. |
46,178,114 | I'm receiving following error message when trying to debug a project on Eclipse Oxygen5:
[](https://i.stack.imgur.com/SnAts.png)
This Eclipse installation was made on a new machine along with JDK1.8.0\_144 and JRE1.8.0\_144. I then copied the workspace folde... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46178114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8597978/"
] | I had the same problem. After investigating, I've found that removing my debug configurations fixes the problem. So, in your debug config, remove
`Xrunjdwp:transport=dt_socket,suspend=n,address=8000,server=y` | In Brazil Warsaw cause this error on eclipse.
You can uninstall Warsaw from your computer by using the Add/Remove Program feature in the Window's Control Panel.
This solved my problem. |
46,178,114 | I'm receiving following error message when trying to debug a project on Eclipse Oxygen5:
[](https://i.stack.imgur.com/SnAts.png)
This Eclipse installation was made on a new machine along with JDK1.8.0\_144 and JRE1.8.0\_144. I then copied the workspace folde... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46178114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8597978/"
] | I had the same problem. After investigating, I've found that removing my debug configurations fixes the problem. So, in your debug config, remove
`Xrunjdwp:transport=dt_socket,suspend=n,address=8000,server=y` | I had the same error and I could fix it selecting another JRE to run the application, i.e., the project JRE instead of a custom JRE.
[](https://i.stack.imgur.com/88kjt.jpg) |
46,178,114 | I'm receiving following error message when trying to debug a project on Eclipse Oxygen5:
[](https://i.stack.imgur.com/SnAts.png)
This Eclipse installation was made on a new machine along with JDK1.8.0\_144 and JRE1.8.0\_144. I then copied the workspace folde... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46178114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8597978/"
] | I had the same error and I could fix it selecting another JRE to run the application, i.e., the project JRE instead of a custom JRE.
[](https://i.stack.imgur.com/88kjt.jpg) | In Brazil Warsaw cause this error on eclipse.
You can uninstall Warsaw from your computer by using the Add/Remove Program feature in the Window's Control Panel.
This solved my problem. |
46,178,114 | I'm receiving following error message when trying to debug a project on Eclipse Oxygen5:
[](https://i.stack.imgur.com/SnAts.png)
This Eclipse installation was made on a new machine along with JDK1.8.0\_144 and JRE1.8.0\_144. I then copied the workspace folde... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46178114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8597978/"
] | I had a same or similar problem with latest **Eclipse-2019-12-R** + I had in the console:
```
Error opening zip file or JAR manifest missing : D:\
Error occurred during initialization of VM
agent library failed to init: instrument
```
The problem was caused by the **'=' character in the path to the eclipse**:
D:\=f... | I got a similar error because i had set the initial size of the heap grater than the maximal amount assigned (on a jboss server).
>
> -server -Xms2048m -Xmx1024m
> to
> -server **-Xms2048m -Xmx2048m**
>
>
> |
46,178,114 | I'm receiving following error message when trying to debug a project on Eclipse Oxygen5:
[](https://i.stack.imgur.com/SnAts.png)
This Eclipse installation was made on a new machine along with JDK1.8.0\_144 and JRE1.8.0\_144. I then copied the workspace folde... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46178114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8597978/"
] | I had a same or similar problem with latest **Eclipse-2019-12-R** + I had in the console:
```
Error opening zip file or JAR manifest missing : D:\
Error occurred during initialization of VM
agent library failed to init: instrument
```
The problem was caused by the **'=' character in the path to the eclipse**:
D:\=f... | I had the same problem...
Create a new java project, make a new simple class (main and sysout) and try to run debug. If it works then the problem is in the project.
Considering that problem is in the project do this:
1. Delete files in ".settings" folder, inside project folder.
2. Remake facets in project settings.
... |
46,178,114 | I'm receiving following error message when trying to debug a project on Eclipse Oxygen5:
[](https://i.stack.imgur.com/SnAts.png)
This Eclipse installation was made on a new machine along with JDK1.8.0\_144 and JRE1.8.0\_144. I then copied the workspace folde... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46178114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8597978/"
] | I had the same problem, and, after uninstalling JRE/JDK, recovering Eclipse files and a whole afternoon of research, I found that the error "**Cannot connect to VM Socket operation on nonsocket: configureBlocking**" didn't happen anymore after *changing my default output folder from a linked resource to a local folder*... | I had the same error and I could fix it selecting another JRE to run the application, i.e., the project JRE instead of a custom JRE.
[](https://i.stack.imgur.com/88kjt.jpg) |
46,178,114 | I'm receiving following error message when trying to debug a project on Eclipse Oxygen5:
[](https://i.stack.imgur.com/SnAts.png)
This Eclipse installation was made on a new machine along with JDK1.8.0\_144 and JRE1.8.0\_144. I then copied the workspace folde... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46178114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8597978/"
] | I had the same problem. After investigating, I've found that removing my debug configurations fixes the problem. So, in your debug config, remove
`Xrunjdwp:transport=dt_socket,suspend=n,address=8000,server=y` | I got a similar error because i had set the initial size of the heap grater than the maximal amount assigned (on a jboss server).
>
> -server -Xms2048m -Xmx1024m
> to
> -server **-Xms2048m -Xmx2048m**
>
>
> |
46,178,114 | I'm receiving following error message when trying to debug a project on Eclipse Oxygen5:
[](https://i.stack.imgur.com/SnAts.png)
This Eclipse installation was made on a new machine along with JDK1.8.0\_144 and JRE1.8.0\_144. I then copied the workspace folde... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46178114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8597978/"
] | I had a same or similar problem with latest **Eclipse-2019-12-R** + I had in the console:
```
Error opening zip file or JAR manifest missing : D:\
Error occurred during initialization of VM
agent library failed to init: instrument
```
The problem was caused by the **'=' character in the path to the eclipse**:
D:\=f... | Deleting and re-importing project in the eclipse worked for me. |
18,333,866 | I have five tabs in my application say A,B,C,D and E.My problem is that application stopped while changing the tab from B to any other tabs and rotating the device into landscape mode or portrait mode.
Error log is
>
> 08-22 11:27:22.835: E/AndroidRuntime(5992): FATAL EXCEPTION: main
> 08-22 11:27:22.835: E/Androi... | 2013/08/20 | [
"https://Stackoverflow.com/questions/18333866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2648262/"
] | Add the `android:configChanges="orientation"` in the android manifest, it handles the orientation change event in application.
Manifest:
```
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:configChanges="orientation"
>
<intent-filte... | Rotating the Device restarts your app again:
OnActivityCreated Method is called and you are getting a null pointer exception here:
```
Caused by: java.lang.NullPointerException
08-20 16:54:43.319: E/AndroidRuntime(5646): at com.nv.netmdapp1.ScheduleDailyView.onActivityCreated(ScheduleDailyView.java:89)
```
Chec... |
28,531,384 | I want to change the url of my wordpress, I have read that I can make that with rewrite rule but it does not work me unfortunately. Here are the details:
I have a wordpress theme, which got me that kind of URL:
```
www.my-theme.pl/portfolio_category/red-flower/
www.my-theme.pl/portfolio_category/blue-flower/
www.my-t... | 2015/02/15 | [
"https://Stackoverflow.com/questions/28531384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4569829/"
] | Before you update image, you need to dispose it. I had similar problem.
**Like so:**
```
VideoDisplay.Image.Dispose();
```
After that line of code, update the image.
**For your scenario:**
```
VideoDisplay.Image = displayImage;
``` | Found the answer turned out by removing the VideoDisplay.Dispose() it fixed it.
By having a quick look up on this there may have been a lock put on the object which the GC cannot then collect. |
15,527,784 | I want to delete a particular row from a DataTable named dt.
For a table in SQL, I could do something like:
```
DELETE FROM dt
WHERE BASELINE_FOLDER = baselineSubfolder
AND BASELINE_FILE = baselineFilename
AND BASELINE_CHECKSUM = baselineChecksum;
```
Is there an equivalent LINQ statement for this? | 2013/03/20 | [
"https://Stackoverflow.com/questions/15527784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1985189/"
] | Assuming you don't have the model's and only a `DataTable` (this is what I understand from the OP).
```
//Cast to enumerable of `DataRow` and filter on your condition
var rows = dt.Rows.Cast<DataRow>().Where(row => row["BASELINE_FOLDER"] == baselineSubFolder && row["BASELINE_FILE" == baselineFilename
&& row["BASELINE_... | you can convert the data table to list and can use `RemoveAt()` to do so.
You can convert it to list and use the below code
```
string baseLineFolder=dt.Rows["BASELINE_FOLDER"].ToString();
string baseLineFile=dt.Rows["BASELINE_FILE"].ToString();
string baseLineChecksum=dt.Rows["BASELIN... |
108,225 | For a world I am working on humans managed to create a race of demi-human cat people. These people where tradionality treated as slaves/property but have in recent times been gaining some degree of freedom. Slavery has not been outlawed and there still exists large numbers of slaves many of who live in very poor condit... | 2018/03/30 | [
"https://worldbuilding.stackexchange.com/questions/108225",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/31830/"
] | **It is the cats who should be able to see things the full humans cannot.**
[](https://i.stack.imgur.com/z3c9B.jpg)
>
> In gay-themed ads, advertisers employ culturally meaningful symbols or
> iconographies as part of an effort to not alienate nongay consumers.
> <ht... | **Cats May be Able to See Into the Ultra-Violet Spectrum**
Some recent studies seem to indicate that cats may have at least some ability to see into the ultra-violet. Obviously using graffiti or marking areas as unsafe or safe could be achieved (somewhat) clandestinely by using inks that only show in the UV spectrum. ... |
108,225 | For a world I am working on humans managed to create a race of demi-human cat people. These people where tradionality treated as slaves/property but have in recent times been gaining some degree of freedom. Slavery has not been outlawed and there still exists large numbers of slaves many of who live in very poor condit... | 2018/03/30 | [
"https://worldbuilding.stackexchange.com/questions/108225",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/31830/"
] | **It is the cats who should be able to see things the full humans cannot.**
[](https://i.stack.imgur.com/z3c9B.jpg)
>
> In gay-themed ads, advertisers employ culturally meaningful symbols or
> iconographies as part of an effort to not alienate nongay consumers.
> <ht... | For the demi-cats, signs should be hidden in **plain sight.**
A reason for this, is **have you wondered why cats stare at walls or even *nothing*?**
[](https://i.stack.imgur.com/Cf4J0.jpg)
>
> "When cats appear to be staring into space, they may a... |
729 | Are there really such thing as sheidim? If so, what are they? Please include sources. | 2010/04/09 | [
"https://judaism.stackexchange.com/questions/729",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/106/"
] | Unless we assume it is all allegory, the Talmud is replete with references to Mazikin, aka Sheidim, and they sure sound real.
Rabbis even had conversations with them (e.g. [Chullin 105b](http://hebrewbooks.org/shas.aspx?mesechta=31&daf=105b&format=pdf)), provided a way to see them ([Berachot 6a](http://hebrewbooks.org... | It is true that the Talmud Bavli clearly mentions shedim in many places. As in other areas, they followed the science of the time, so something that seems unscientific now was a reasonable belief back then.
However, that doesn't mean they were completely wrong. They felt there were certain harmful invisible forces t... |
729 | Are there really such thing as sheidim? If so, what are they? Please include sources. | 2010/04/09 | [
"https://judaism.stackexchange.com/questions/729",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/106/"
] | Ralbag writes that *sheidim* are imaginary. He goes a step further than most other authorities who deny the existence of *sheidim* and actually attempts to prove that the Sages themselves (despite all their discussions about *sheidim*) believed that *sheidim* are imaginary.
The Talmud records the following about *shei... | Demons as they appear in the Bavli seem to be a Babylonian belief because:
* The Yerushalmi hardly mentions them
* The Babylonians were quite
concerned with protecting themselves from demons as we see from their
[incantation bowls](https://en.wikipedia.org/wiki/Incantation_bowl)
* The name Lilith (one of the demons) i... |
729 | Are there really such thing as sheidim? If so, what are they? Please include sources. | 2010/04/09 | [
"https://judaism.stackexchange.com/questions/729",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/106/"
] | The gemara clearly mentions sheidim, and there were certainly Rishonim (e.g. Rashi) and Acharonim who took these mentions literally.
The Rambam takes them non-literally, as he writes in Moreh Nevuchim 1:7 and in his perush haMishnayot to Avodah Zarah 4:7.
The Kotzker Rebbe has a famous elu veElu in which he explains ... | It is true that the Talmud Bavli clearly mentions shedim in many places. As in other areas, they followed the science of the time, so something that seems unscientific now was a reasonable belief back then.
However, that doesn't mean they were completely wrong. They felt there were certain harmful invisible forces t... |
729 | Are there really such thing as sheidim? If so, what are they? Please include sources. | 2010/04/09 | [
"https://judaism.stackexchange.com/questions/729",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/106/"
] | The straightandforward understanding of Chazal is that there are sheidim and that they are a troublemaking species which are somewhat physical, somewhat spiritual.
>
> Our Rabbis taught: Six things are said
> concerning demons: in regard to three,
> they are like the ministering angels;
> and in regard to three li... | Ralbag writes that *sheidim* are imaginary. He goes a step further than most other authorities who deny the existence of *sheidim* and actually attempts to prove that the Sages themselves (despite all their discussions about *sheidim*) believed that *sheidim* are imaginary.
The Talmud records the following about *shei... |
729 | Are there really such thing as sheidim? If so, what are they? Please include sources. | 2010/04/09 | [
"https://judaism.stackexchange.com/questions/729",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/106/"
] | Unless we assume it is all allegory, the Talmud is replete with references to Mazikin, aka Sheidim, and they sure sound real.
Rabbis even had conversations with them (e.g. [Chullin 105b](http://hebrewbooks.org/shas.aspx?mesechta=31&daf=105b&format=pdf)), provided a way to see them ([Berachot 6a](http://hebrewbooks.org... | The gemara clearly mentions sheidim, and there were certainly Rishonim (e.g. Rashi) and Acharonim who took these mentions literally.
The Rambam takes them non-literally, as he writes in Moreh Nevuchim 1:7 and in his perush haMishnayot to Avodah Zarah 4:7.
The Kotzker Rebbe has a famous elu veElu in which he explains ... |
729 | Are there really such thing as sheidim? If so, what are they? Please include sources. | 2010/04/09 | [
"https://judaism.stackexchange.com/questions/729",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/106/"
] | The gemara clearly mentions sheidim, and there were certainly Rishonim (e.g. Rashi) and Acharonim who took these mentions literally.
The Rambam takes them non-literally, as he writes in Moreh Nevuchim 1:7 and in his perush haMishnayot to Avodah Zarah 4:7.
The Kotzker Rebbe has a famous elu veElu in which he explains ... | Ralbag writes that *sheidim* are imaginary. He goes a step further than most other authorities who deny the existence of *sheidim* and actually attempts to prove that the Sages themselves (despite all their discussions about *sheidim*) believed that *sheidim* are imaginary.
The Talmud records the following about *shei... |
729 | Are there really such thing as sheidim? If so, what are they? Please include sources. | 2010/04/09 | [
"https://judaism.stackexchange.com/questions/729",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/106/"
] | The Rambam, practically alone among the major commentators, has the almost unique view that sheidim do not exist, and the entire idea was a simple superstition, played upon by the Sages for use parables and other concepts. Consequently, he interpreted all the Gemaros and Midrashim that mention sheidim as allegories or ... | The Meiri reinterprets "mazikin" and the like wherever they appear in Shas as anthing from the evil inclination to thoughts of heresy. See [here](https://seforimblog.com/2014/06/demythologising-rabbinic-aggada/) which lists instances of such reinterpretation by the Meiri. |
729 | Are there really such thing as sheidim? If so, what are they? Please include sources. | 2010/04/09 | [
"https://judaism.stackexchange.com/questions/729",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/106/"
] | Unless we assume it is all allegory, the Talmud is replete with references to Mazikin, aka Sheidim, and they sure sound real.
Rabbis even had conversations with them (e.g. [Chullin 105b](http://hebrewbooks.org/shas.aspx?mesechta=31&daf=105b&format=pdf)), provided a way to see them ([Berachot 6a](http://hebrewbooks.org... | The straightandforward understanding of Chazal is that there are sheidim and that they are a troublemaking species which are somewhat physical, somewhat spiritual.
>
> Our Rabbis taught: Six things are said
> concerning demons: in regard to three,
> they are like the ministering angels;
> and in regard to three li... |
729 | Are there really such thing as sheidim? If so, what are they? Please include sources. | 2010/04/09 | [
"https://judaism.stackexchange.com/questions/729",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/106/"
] | The Meiri reinterprets "mazikin" and the like wherever they appear in Shas as anthing from the evil inclination to thoughts of heresy. See [here](https://seforimblog.com/2014/06/demythologising-rabbinic-aggada/) which lists instances of such reinterpretation by the Meiri. | Demons as they appear in the Bavli seem to be a Babylonian belief because:
* The Yerushalmi hardly mentions them
* The Babylonians were quite
concerned with protecting themselves from demons as we see from their
[incantation bowls](https://en.wikipedia.org/wiki/Incantation_bowl)
* The name Lilith (one of the demons) i... |
729 | Are there really such thing as sheidim? If so, what are they? Please include sources. | 2010/04/09 | [
"https://judaism.stackexchange.com/questions/729",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/106/"
] | The straightandforward understanding of Chazal is that there are sheidim and that they are a troublemaking species which are somewhat physical, somewhat spiritual.
>
> Our Rabbis taught: Six things are said
> concerning demons: in regard to three,
> they are like the ministering angels;
> and in regard to three li... | The Meiri reinterprets "mazikin" and the like wherever they appear in Shas as anthing from the evil inclination to thoughts of heresy. See [here](https://seforimblog.com/2014/06/demythologising-rabbinic-aggada/) which lists instances of such reinterpretation by the Meiri. |
1,153,897 | I am new to both Django and Rails. I am thinking of developing an Web 2.0 style application and is planning to expose Restful services, which my UI tier would call to make CRUD operations (Something similar to ADO.NET Data services)
I am yet to decide on the platforms and is looking for some advice on which one to sid... | 2009/07/20 | [
"https://Stackoverflow.com/questions/1153897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30594/"
] | Seq.append:
```
> let x = { 1 .. 5 };;
val x : seq<int>
> let y = Seq.append x [9];; // [9] is a single-element list literal
val y : seq<int>
> y |> Seq.toList;;
val it : int list = [1; 2; 3; 4; 5; 9]
``` | There's also an imperative solution...
```
> let x = seq {1..5}
> let y = seq { yield! x; yield 9 } // Flatten the list,then append your element
> Seq.to_list y;;
val it : int list = [1; 2; 3; 4; 5; 9]
```
This may be better if the underlying problem is an imperative one, and it is most natural to use a *yield* sta... |
1,153,897 | I am new to both Django and Rails. I am thinking of developing an Web 2.0 style application and is planning to expose Restful services, which my UI tier would call to make CRUD operations (Something similar to ADO.NET Data services)
I am yet to decide on the platforms and is looking for some advice on which one to sid... | 2009/07/20 | [
"https://Stackoverflow.com/questions/1153897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30594/"
] | Seq.append:
```
> let x = { 1 .. 5 };;
val x : seq<int>
> let y = Seq.append x [9];; // [9] is a single-element list literal
val y : seq<int>
> y |> Seq.toList;;
val it : int list = [1; 2; 3; 4; 5; 9]
``` | You can also use
```
let newSeq = Seq.append oldSeq (Seq.singleton newElem)
```
Which is a slight modification of the first answer but appends sequences instead of a list to a sequence.
given the following code
```
let startSeq = seq {1..100}
let AppendTest = Seq.append startSeq [101] |> List.ofSeq
let AppendTes... |
1,153,897 | I am new to both Django and Rails. I am thinking of developing an Web 2.0 style application and is planning to expose Restful services, which my UI tier would call to make CRUD operations (Something similar to ADO.NET Data services)
I am yet to decide on the platforms and is looking for some advice on which one to sid... | 2009/07/20 | [
"https://Stackoverflow.com/questions/1153897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30594/"
] | You can also use
```
let newSeq = Seq.append oldSeq (Seq.singleton newElem)
```
Which is a slight modification of the first answer but appends sequences instead of a list to a sequence.
given the following code
```
let startSeq = seq {1..100}
let AppendTest = Seq.append startSeq [101] |> List.ofSeq
let AppendTes... | There's also an imperative solution...
```
> let x = seq {1..5}
> let y = seq { yield! x; yield 9 } // Flatten the list,then append your element
> Seq.to_list y;;
val it : int list = [1; 2; 3; 4; 5; 9]
```
This may be better if the underlying problem is an imperative one, and it is most natural to use a *yield* sta... |
10,647,874 | ```
public class tryAnimActivity extends Activity
{
/**
* The thread to process splash screen events
*/
private Thread mSplashThread;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Splas... | 2012/05/18 | [
"https://Stackoverflow.com/questions/10647874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1327205/"
] | You cannot set `.innerHTML` directly off the jQuery object. You need to set `$.html()` instead.
```
// jQuery doesn't have an innerHTML property, so this is wrong
$("#dialog").innerHTML = "This is the wrong way";
// jQuery has an html() method that sets the html within your dialog
$("#dialog").html( "And this is the ... | This is the way to do:
In javascript:
```
document.getElementById('dialog').innerHTML = 'something';
```
In Jquery :
```
$("#dialog").html('something');
``` |
4,976,200 | I want to show some effect (animate) with the help of jQuery during the time that should be calculated based on how many results are found for a particular needle. The rule is that the effect should continue no longer than 5 minutes and at the very least be 5 seconds long.
So, here's what I do in particular. I search ... | 2011/02/12 | [
"https://Stackoverflow.com/questions/4976200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/613908/"
] | <http://jsfiddle.net/rCVnv/3/>
```
$(function(){
var firstNum = Math.random()*10000,
secondNum = Math.random()*10000,
result = parseInt(secondNum - firstNum),
milli = 0;
if(result > 0){
if(result < 300000 && result > 5000){
milli = result;
$("#test").fadeOut... | ```
var intSecondsPerResult = 2;
var intAnimationDuration = intSecondsPerResult*{$intResultsCount};
if(intAnimationDuration < 5) {
intAnimationDuration = 5;
} else if(intAnimationDuration > 300) {
intAnimationDuration = 300;
}
```
PS: $intResultsCount contains the size of your resultset
That is what you want... |
3,687,083 | >
> Given two functions $f(x) = \frac{1}{2}(e^x+e^{-x})$ and $g(x) = \frac{1}{2}(e^x - e^{-x})$, calculate
>
>
> $$ \int\frac{g(x)}{f(x)} \, dx. $$
>
>
>
Observing that $f'(x) = g(x)$, this is very easy to do. Just take $u = f(x)$ and therefore $du = f'(x)\,dx$. Now we have
$$
\int \frac{f'(x)}{f(x)} \, dx = \i... | 2020/05/22 | [
"https://math.stackexchange.com/questions/3687083",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/454828/"
] | Note that if $K$ is a constant, $\ln|K\cdot h(x)|= \ln|K|+\ln|h(x)|$. In other words, the $1/2$ in the log can get 'absorbed' into the $+C$ term. | Using the identity: $ \log (\frac{a}{b})=\log(a)- \log(b)$
$\ln \frac{1}{2}(e^x+e^{-x})+C$
$=\ln (e^x+e^{-x})-\ln 2+C $
$=\ln (e^x+e^{-x})+C{'} $ (as $\ln 2$ is constant) |
3,144,802 | I am running R on a multiple node Linux cluster. I would like to run my analysis on R using scripts or batch mode without using parallel computing software such as MPI or snow.
I know this can be done by dividing the input data such that each node runs different parts of the data.
My question is how do I go about th... | 2010/06/29 | [
"https://Stackoverflow.com/questions/3144802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379465/"
] | This is rather a PBS question; I usually make an R script (with Rscript path after #!) and make it gather a parameter (using `commandArgs` function) that controls which "part of the job" this current instance should make. Because I use `multicore` a lot I usually have to use only 3-4 nodes, so I just submit few jobs ca... | This was an answer to a related question - but it's an answer to the comment above (as well).
For most of our work we do run multiple R sessions in parallel using qsub (instead).
If it is for multiple files I normally do:
```
while read infile rest
do
qsub -v infile=$infile call_r.pbs
done < list_of_infiles.txt
``... |
3,144,802 | I am running R on a multiple node Linux cluster. I would like to run my analysis on R using scripts or batch mode without using parallel computing software such as MPI or snow.
I know this can be done by dividing the input data such that each node runs different parts of the data.
My question is how do I go about th... | 2010/06/29 | [
"https://Stackoverflow.com/questions/3144802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379465/"
] | This is rather a PBS question; I usually make an R script (with Rscript path after #!) and make it gather a parameter (using `commandArgs` function) that controls which "part of the job" this current instance should make. Because I use `multicore` a lot I usually have to use only 3-4 nodes, so I just submit few jobs ca... | This problem seems very well suited for use of GNU parallel. GNU parallel has an excellent tutorial [here](http://www.gnu.org/software/parallel/parallel_tutorial.html). I'm not familiar with `pbsdsh`, and I'm new to HPC, but to me it looks like `pbsdsh` serves a similar purpose as GNU `parallel`. I'm also not familiar ... |
2,898,314 | Let $\ z \not = -1$ be a complex number. Prove $\ \frac{z-1}{z+1} $ is imaginary number iff $\ |z| = 1 $
Assuming $\ |z| = 1 \Rightarrow \sqrt{a^2+b^2} = 1 \Rightarrow a^2+b^2 = 1 $ and so
$$\ \frac{z-1}{z+1} = \frac{a+bi-1}{a+bi+1} = \frac{a-1+bi}{a+1+bi} \cdot \frac{a+1-bi}{a+1-bi} = \frac{(a^2+b^2)-1+2bi}{(a^2+b^2... | 2018/08/29 | [
"https://math.stackexchange.com/questions/2898314",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/468493/"
] | In the last step of your proof, before you use the assumption that $(a^2+b^2)=1$, you've deduced
$$\frac{z-1}{z+1}=\frac{(a^2+b^2)-1+2bi}{(a^2+b^2)+1 +2a}$$
Now, by assumption for the other direction, you have
$$\frac{(a^2+b^2)-1+2bi}{(a^2+b^2)+1 +2a}=xi$$
as $\frac{z-1}{z+1}$ is assumed to be imaginary, i.e. $\fra... | Recall that $w\in \mathbb{C}$ is purely imaginary $\iff w=-\bar w$, then
$$\frac{z-1}{z+1}=-\overline{\left(\frac{z-1}{z+1}\right)} =-\frac{\bar z-1}{\bar z+1} \iff (z-1)(\bar z+1)=-(\bar z-1)(z+1)$$
$$z\bar z+z-\bar z-1=-z\bar z+z-\bar z+1$$
$$2z\bar z=2 \iff|z|^2=1$$ |
2,898,314 | Let $\ z \not = -1$ be a complex number. Prove $\ \frac{z-1}{z+1} $ is imaginary number iff $\ |z| = 1 $
Assuming $\ |z| = 1 \Rightarrow \sqrt{a^2+b^2} = 1 \Rightarrow a^2+b^2 = 1 $ and so
$$\ \frac{z-1}{z+1} = \frac{a+bi-1}{a+bi+1} = \frac{a-1+bi}{a+1+bi} \cdot \frac{a+1-bi}{a+1-bi} = \frac{(a^2+b^2)-1+2bi}{(a^2+b^2... | 2018/08/29 | [
"https://math.stackexchange.com/questions/2898314",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/468493/"
] | Note that\begin{align}\frac{z-1}{z+1}&=\frac{(z-1)\left(\overline z+1\right)}{(z+1)\left(\overline z+1\right)}\\&=\frac{|z|^2+z-\overline z-1}{|z+1|^2}\\&=\frac{|z|^2-1+2i\operatorname{Im}(z)}{|z+1|^2}\end{align}and that therefore $\frac{z-1}{z+1}$ is purely imaginary if and only $|z|^2-1=0$, which is the same thing as... | Recall that $w\in \mathbb{C}$ is purely imaginary $\iff w=-\bar w$, then
$$\frac{z-1}{z+1}=-\overline{\left(\frac{z-1}{z+1}\right)} =-\frac{\bar z-1}{\bar z+1} \iff (z-1)(\bar z+1)=-(\bar z-1)(z+1)$$
$$z\bar z+z-\bar z-1=-z\bar z+z-\bar z+1$$
$$2z\bar z=2 \iff|z|^2=1$$ |
2,898,314 | Let $\ z \not = -1$ be a complex number. Prove $\ \frac{z-1}{z+1} $ is imaginary number iff $\ |z| = 1 $
Assuming $\ |z| = 1 \Rightarrow \sqrt{a^2+b^2} = 1 \Rightarrow a^2+b^2 = 1 $ and so
$$\ \frac{z-1}{z+1} = \frac{a+bi-1}{a+bi+1} = \frac{a-1+bi}{a+1+bi} \cdot \frac{a+1-bi}{a+1-bi} = \frac{(a^2+b^2)-1+2bi}{(a^2+b^2... | 2018/08/29 | [
"https://math.stackexchange.com/questions/2898314",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/468493/"
] | In the last step of your proof, before you use the assumption that $(a^2+b^2)=1$, you've deduced
$$\frac{z-1}{z+1}=\frac{(a^2+b^2)-1+2bi}{(a^2+b^2)+1 +2a}$$
Now, by assumption for the other direction, you have
$$\frac{(a^2+b^2)-1+2bi}{(a^2+b^2)+1 +2a}=xi$$
as $\frac{z-1}{z+1}$ is assumed to be imaginary, i.e. $\fra... | Another approach
$${\bf Re}\dfrac{z-1}{z+1}={\bf Re}\dfrac{(z-1)(\bar{z}+1)}{|z+1|^2}=\dfrac{|z|^2-1}{|z+1|^2}=0 \iff |z|=1$$ |
2,898,314 | Let $\ z \not = -1$ be a complex number. Prove $\ \frac{z-1}{z+1} $ is imaginary number iff $\ |z| = 1 $
Assuming $\ |z| = 1 \Rightarrow \sqrt{a^2+b^2} = 1 \Rightarrow a^2+b^2 = 1 $ and so
$$\ \frac{z-1}{z+1} = \frac{a+bi-1}{a+bi+1} = \frac{a-1+bi}{a+1+bi} \cdot \frac{a+1-bi}{a+1-bi} = \frac{(a^2+b^2)-1+2bi}{(a^2+b^2... | 2018/08/29 | [
"https://math.stackexchange.com/questions/2898314",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/468493/"
] | In the last step of your proof, before you use the assumption that $(a^2+b^2)=1$, you've deduced
$$\frac{z-1}{z+1}=\frac{(a^2+b^2)-1+2bi}{(a^2+b^2)+1 +2a}$$
Now, by assumption for the other direction, you have
$$\frac{(a^2+b^2)-1+2bi}{(a^2+b^2)+1 +2a}=xi$$
as $\frac{z-1}{z+1}$ is assumed to be imaginary, i.e. $\fra... | Assume $z\ne\pm1$. Then ${z-1\over z+1}\in i{\mathbb R}$ means that, viewed from $z$, the two points $\pm1$ are seen under a right angle. By Thales' theorem this is the case iff $z$ is lying on a circle with diameter $[{-1},1]$. |
2,898,314 | Let $\ z \not = -1$ be a complex number. Prove $\ \frac{z-1}{z+1} $ is imaginary number iff $\ |z| = 1 $
Assuming $\ |z| = 1 \Rightarrow \sqrt{a^2+b^2} = 1 \Rightarrow a^2+b^2 = 1 $ and so
$$\ \frac{z-1}{z+1} = \frac{a+bi-1}{a+bi+1} = \frac{a-1+bi}{a+1+bi} \cdot \frac{a+1-bi}{a+1-bi} = \frac{(a^2+b^2)-1+2bi}{(a^2+b^2... | 2018/08/29 | [
"https://math.stackexchange.com/questions/2898314",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/468493/"
] | Note that\begin{align}\frac{z-1}{z+1}&=\frac{(z-1)\left(\overline z+1\right)}{(z+1)\left(\overline z+1\right)}\\&=\frac{|z|^2+z-\overline z-1}{|z+1|^2}\\&=\frac{|z|^2-1+2i\operatorname{Im}(z)}{|z+1|^2}\end{align}and that therefore $\frac{z-1}{z+1}$ is purely imaginary if and only $|z|^2-1=0$, which is the same thing as... | Another approach
$${\bf Re}\dfrac{z-1}{z+1}={\bf Re}\dfrac{(z-1)(\bar{z}+1)}{|z+1|^2}=\dfrac{|z|^2-1}{|z+1|^2}=0 \iff |z|=1$$ |
2,898,314 | Let $\ z \not = -1$ be a complex number. Prove $\ \frac{z-1}{z+1} $ is imaginary number iff $\ |z| = 1 $
Assuming $\ |z| = 1 \Rightarrow \sqrt{a^2+b^2} = 1 \Rightarrow a^2+b^2 = 1 $ and so
$$\ \frac{z-1}{z+1} = \frac{a+bi-1}{a+bi+1} = \frac{a-1+bi}{a+1+bi} \cdot \frac{a+1-bi}{a+1-bi} = \frac{(a^2+b^2)-1+2bi}{(a^2+b^2... | 2018/08/29 | [
"https://math.stackexchange.com/questions/2898314",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/468493/"
] | Note that\begin{align}\frac{z-1}{z+1}&=\frac{(z-1)\left(\overline z+1\right)}{(z+1)\left(\overline z+1\right)}\\&=\frac{|z|^2+z-\overline z-1}{|z+1|^2}\\&=\frac{|z|^2-1+2i\operatorname{Im}(z)}{|z+1|^2}\end{align}and that therefore $\frac{z-1}{z+1}$ is purely imaginary if and only $|z|^2-1=0$, which is the same thing as... | Assume $z\ne\pm1$. Then ${z-1\over z+1}\in i{\mathbb R}$ means that, viewed from $z$, the two points $\pm1$ are seen under a right angle. By Thales' theorem this is the case iff $z$ is lying on a circle with diameter $[{-1},1]$. |
5,089,065 | I want to remove all the prepositions(in, at, on...), definite articles(a, an ,the...) and be verbs(is, are, was...) from a article. Is there a short way that php can do that?
```
$article= "the cup is on the table";// I want get an echo like "cup table"
``` | 2011/02/23 | [
"https://Stackoverflow.com/questions/5089065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/547726/"
] | You can use [str\_ireplace()](http://php.net/manual/en/function.str-ireplace.php), create an array with the words you want gone and use `str_ireplace($prepArr,'',$str);` | I found a useful solution, try below code or you can add your words in $commonWords array.
```
function removeCommonWords($input){
$commonWords = array('a','able','about','above','abroad','according','accordingly','across','actually','adj','after','afterwards','again','against','ago','ahead','ain\'t','all','allow... |
5,089,065 | I want to remove all the prepositions(in, at, on...), definite articles(a, an ,the...) and be verbs(is, are, was...) from a article. Is there a short way that php can do that?
```
$article= "the cup is on the table";// I want get an echo like "cup table"
``` | 2011/02/23 | [
"https://Stackoverflow.com/questions/5089065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/547726/"
] | The key thing is to ensure you only replace whole words (e.g. not the "the" in "there"), for which you can use `\b` in PCRE:
```
$words = array('in', 'at', 'on', 'etc..');
$pattern = '/\b(?:' . join('|', $words) . ')\b/i';
$article = preg_replace($pattern, '', $article);
```
Caveat 1: If you have a very large number... | Yup, simply call a str\_ireplace()
```
$banned = array(' a ', ' an ', ' the '); //add more words as you want. KEEP THE SPACE around the word
$article = 'The cup is on the table';
$clear = str_ireplace($banned, ' ', $article); //replaced with a space for now. put something else if you want
```
$clear will now be $a... |
5,089,065 | I want to remove all the prepositions(in, at, on...), definite articles(a, an ,the...) and be verbs(is, are, was...) from a article. Is there a short way that php can do that?
```
$article= "the cup is on the table";// I want get an echo like "cup table"
``` | 2011/02/23 | [
"https://Stackoverflow.com/questions/5089065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/547726/"
] | Yup, simply call a str\_ireplace()
```
$banned = array(' a ', ' an ', ' the '); //add more words as you want. KEEP THE SPACE around the word
$article = 'The cup is on the table';
$clear = str_ireplace($banned, ' ', $article); //replaced with a space for now. put something else if you want
```
$clear will now be $a... | I found a useful solution, try below code or you can add your words in $commonWords array.
```
function removeCommonWords($input){
$commonWords = array('a','able','about','above','abroad','according','accordingly','across','actually','adj','after','afterwards','again','against','ago','ahead','ain\'t','all','allow... |
5,089,065 | I want to remove all the prepositions(in, at, on...), definite articles(a, an ,the...) and be verbs(is, are, was...) from a article. Is there a short way that php can do that?
```
$article= "the cup is on the table";// I want get an echo like "cup table"
``` | 2011/02/23 | [
"https://Stackoverflow.com/questions/5089065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/547726/"
] | ```
str_replace(Array(' in ', ' at ', ' on ', ' a ', ' an ', ' the '), '', $article);
```
Edit: better, using preg\_replace:
```
$article = 'The cup is on the table.The theble aon is';
echo "<br/>". ($article = preg_replace("/(\W|^)(is|on|a|the)(\W|$)/i", ' ', $article));
echo "<br/>". ($article = preg_replace("/(\W... | You can use [str\_ireplace()](http://php.net/manual/en/function.str-ireplace.php), create an array with the words you want gone and use `str_ireplace($prepArr,'',$str);` |
5,089,065 | I want to remove all the prepositions(in, at, on...), definite articles(a, an ,the...) and be verbs(is, are, was...) from a article. Is there a short way that php can do that?
```
$article= "the cup is on the table";// I want get an echo like "cup table"
``` | 2011/02/23 | [
"https://Stackoverflow.com/questions/5089065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/547726/"
] | The key thing is to ensure you only replace whole words (e.g. not the "the" in "there"), for which you can use `\b` in PCRE:
```
$words = array('in', 'at', 'on', 'etc..');
$pattern = '/\b(?:' . join('|', $words) . ')\b/i';
$article = preg_replace($pattern, '', $article);
```
Caveat 1: If you have a very large number... | ```
echo str_replace(array(' the ', ' is ', ' on ', ' a '), ' ', $article);
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.