qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
750,659 | I have an example that I don't understand, especially 2 expressions.
Given a spin in the state $|z + \rangle$, i.e., pointing up along the z-axis what are the
probabilities of measuring $\pm \hbar/2$ along $\hat{n}$?
I have these 2 expressions
$$|+\rangle\_n = cos(\theta/2)e^{-i\phi/2}|+\rangle +sin(\theta/2)e^{i\ph... | 2023/02/18 | [
"https://physics.stackexchange.com/questions/750659",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/354087/"
] | >
> If I'm sitting on the edge of a rotating merry-go-round, then from my perspective the world is rotating around me.
>
>
>
No, it isn't. Think about this carefully (or find a merry-go-round and do a practical experiment). From your perspective the merry-go-round is stationary and the rest of the world is rotatin... | If there is a non rotating object (like a pole) in the center of the merry go round, this object will look rotating around itself, from the edge person perspective.
But all other non rotating objects (the rest of the world) will rotate around the pole in the center.
It is easy to see that for non rotating objects clo... |
750,659 | I have an example that I don't understand, especially 2 expressions.
Given a spin in the state $|z + \rangle$, i.e., pointing up along the z-axis what are the
probabilities of measuring $\pm \hbar/2$ along $\hat{n}$?
I have these 2 expressions
$$|+\rangle\_n = cos(\theta/2)e^{-i\phi/2}|+\rangle +sin(\theta/2)e^{i\ph... | 2023/02/18 | [
"https://physics.stackexchange.com/questions/750659",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/354087/"
] | >
> If I'm sitting on the edge of a rotating merry-go-round, then from my perspective the world is rotating around me.
>
>
>
No, it isn't. Think about this carefully (or find a merry-go-round and do a practical experiment). From your perspective the merry-go-round is stationary and the rest of the world is rotatin... | $\def \b {\mathbf}$
[](https://i.stack.imgur.com/oYYtO.png)
[](https://i.stack.imgur.com/agfvO.png)
In both cases the center of rotation is the same ,but you are looking at the obje... |
65,701,915 | I have a function that checks if a given string is in a list of strings using a for and while loop. I’m not supposed to use the ‘in’ operator. Here’s my code using a for loop:
```
def word_in_list(words, word):
for strings in words:
if len(words) > 0 and strings == word:
return True
els... | 2021/01/13 | [
"https://Stackoverflow.com/questions/65701915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14341787/"
] | Don’t return `False` the moment you find one mismatch, return `False` when you are done checking all possibilities and not finding any match:
```
def word_in_list(words, word):
for strings in words:
if strings == word:
return True
return False
```
Also, no need to check the length of list... | Your code is wrong because of the else statement. Your function must return False only after checking the whole list, not just the first element. Whenever a function gets to a "return" instruction, it stops, so it just checked the first one. This is the correct solution:
```
def word_in_list(words, word):
i = 0
... |
65,701,915 | I have a function that checks if a given string is in a list of strings using a for and while loop. I’m not supposed to use the ‘in’ operator. Here’s my code using a for loop:
```
def word_in_list(words, word):
for strings in words:
if len(words) > 0 and strings == word:
return True
els... | 2021/01/13 | [
"https://Stackoverflow.com/questions/65701915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14341787/"
] | Don’t return `False` the moment you find one mismatch, return `False` when you are done checking all possibilities and not finding any match:
```
def word_in_list(words, word):
for strings in words:
if strings == word:
return True
return False
```
Also, no need to check the length of list... | simly use this code
```
def word_in_list(words, word):
if word in words:
return True
else
return False
``` |
65,701,915 | I have a function that checks if a given string is in a list of strings using a for and while loop. I’m not supposed to use the ‘in’ operator. Here’s my code using a for loop:
```
def word_in_list(words, word):
for strings in words:
if len(words) > 0 and strings == word:
return True
els... | 2021/01/13 | [
"https://Stackoverflow.com/questions/65701915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14341787/"
] | Don’t return `False` the moment you find one mismatch, return `False` when you are done checking all possibilities and not finding any match:
```
def word_in_list(words, word):
for strings in words:
if strings == word:
return True
return False
```
Also, no need to check the length of list... | Your else block kicks-in without finishing the iteration on complete list.
```
def word_in_list(list_of_words, word_to_search):
found = False
for word in list_of_words:
if word == word_to_search:
found = True
break # breaks iff the word is found
return found
```
Any parti... |
6,667,210 | I have a data structure that looks like this
```
[{'name': 'sfsdf sdfsdf', 'id': '621205528'},
{'name': 'test name', 'id': '32324234234'},
{'name': 'another name', 'id': '3434535342221'}]
```
Now I have a model called Profile where the id in the dictionary maps to the uid field in the model.
I'd like to remove e... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6667210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240474/"
] | This is how I would do it:
```
data = [{'name': 'sfsdf sdfsdf', 'id': '621205528'},
{'name': 'test name', 'id': '32324234234'},
{'name': 'another name', 'id': '3434535342221'}]
Profile.objects.filter(id__in=[x['id'] for x in data]).delete()
```
A more fleshed-out version:
```
ids = [x['id'] for x in data] # gives... | Assuming there are not hundreds of records to delete, you can use the below.
```
objs = [{'name': 'sfsdf sdfsdf', 'id': '621205528'}, ...]
Profile.objects.filter(id__in=[x.get('id') for x in objs]).delete()
``` |
6,667,210 | I have a data structure that looks like this
```
[{'name': 'sfsdf sdfsdf', 'id': '621205528'},
{'name': 'test name', 'id': '32324234234'},
{'name': 'another name', 'id': '3434535342221'}]
```
Now I have a model called Profile where the id in the dictionary maps to the uid field in the model.
I'd like to remove e... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6667210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240474/"
] | You could get a matching list from the db in one go, and compare:
```
db_ids = set(Profile.objects.values_list('uid', flat=True))
my_ids = set([d['id'] for d in original_list])
ids_to_keep = my_ids - db_ids
list_to_keep = [l for l in original_list if l['id'] in ids_to_keep]
``` | This is how I would do it:
```
data = [{'name': 'sfsdf sdfsdf', 'id': '621205528'},
{'name': 'test name', 'id': '32324234234'},
{'name': 'another name', 'id': '3434535342221'}]
Profile.objects.filter(id__in=[x['id'] for x in data]).delete()
```
A more fleshed-out version:
```
ids = [x['id'] for x in data] # gives... |
6,667,210 | I have a data structure that looks like this
```
[{'name': 'sfsdf sdfsdf', 'id': '621205528'},
{'name': 'test name', 'id': '32324234234'},
{'name': 'another name', 'id': '3434535342221'}]
```
Now I have a model called Profile where the id in the dictionary maps to the uid field in the model.
I'd like to remove e... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6667210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240474/"
] | ```
ids = [x['id'] for x in my_list]
existing_ids = Profile.objects.filter(id__in=ids).values_list('id', flat=True)
result = filter(lambda elm: elm['id'] in existing_ids, my_list)
``` | This is how I would do it:
```
data = [{'name': 'sfsdf sdfsdf', 'id': '621205528'},
{'name': 'test name', 'id': '32324234234'},
{'name': 'another name', 'id': '3434535342221'}]
Profile.objects.filter(id__in=[x['id'] for x in data]).delete()
```
A more fleshed-out version:
```
ids = [x['id'] for x in data] # gives... |
6,667,210 | I have a data structure that looks like this
```
[{'name': 'sfsdf sdfsdf', 'id': '621205528'},
{'name': 'test name', 'id': '32324234234'},
{'name': 'another name', 'id': '3434535342221'}]
```
Now I have a model called Profile where the id in the dictionary maps to the uid field in the model.
I'd like to remove e... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6667210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240474/"
] | You could get a matching list from the db in one go, and compare:
```
db_ids = set(Profile.objects.values_list('uid', flat=True))
my_ids = set([d['id'] for d in original_list])
ids_to_keep = my_ids - db_ids
list_to_keep = [l for l in original_list if l['id'] in ids_to_keep]
``` | Assuming there are not hundreds of records to delete, you can use the below.
```
objs = [{'name': 'sfsdf sdfsdf', 'id': '621205528'}, ...]
Profile.objects.filter(id__in=[x.get('id') for x in objs]).delete()
``` |
6,667,210 | I have a data structure that looks like this
```
[{'name': 'sfsdf sdfsdf', 'id': '621205528'},
{'name': 'test name', 'id': '32324234234'},
{'name': 'another name', 'id': '3434535342221'}]
```
Now I have a model called Profile where the id in the dictionary maps to the uid field in the model.
I'd like to remove e... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6667210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240474/"
] | ```
ids = [x['id'] for x in my_list]
existing_ids = Profile.objects.filter(id__in=ids).values_list('id', flat=True)
result = filter(lambda elm: elm['id'] in existing_ids, my_list)
``` | Assuming there are not hundreds of records to delete, you can use the below.
```
objs = [{'name': 'sfsdf sdfsdf', 'id': '621205528'}, ...]
Profile.objects.filter(id__in=[x.get('id') for x in objs]).delete()
``` |
6,667,210 | I have a data structure that looks like this
```
[{'name': 'sfsdf sdfsdf', 'id': '621205528'},
{'name': 'test name', 'id': '32324234234'},
{'name': 'another name', 'id': '3434535342221'}]
```
Now I have a model called Profile where the id in the dictionary maps to the uid field in the model.
I'd like to remove e... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6667210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240474/"
] | First you want to get the list of ids from that model in a list
```
id_list = Profile.objects.filter(whaterever filter).values_list('id', flat=True).order_by('id')
```
This will return a list if integers.
Then eliminate that from your current list:
```
mylist = [{'name': 'sfsdf sdfsdf', 'id': '621205528'}, {'name'... | Assuming there are not hundreds of records to delete, you can use the below.
```
objs = [{'name': 'sfsdf sdfsdf', 'id': '621205528'}, ...]
Profile.objects.filter(id__in=[x.get('id') for x in objs]).delete()
``` |
6,667,210 | I have a data structure that looks like this
```
[{'name': 'sfsdf sdfsdf', 'id': '621205528'},
{'name': 'test name', 'id': '32324234234'},
{'name': 'another name', 'id': '3434535342221'}]
```
Now I have a model called Profile where the id in the dictionary maps to the uid field in the model.
I'd like to remove e... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6667210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240474/"
] | You could get a matching list from the db in one go, and compare:
```
db_ids = set(Profile.objects.values_list('uid', flat=True))
my_ids = set([d['id'] for d in original_list])
ids_to_keep = my_ids - db_ids
list_to_keep = [l for l in original_list if l['id'] in ids_to_keep]
``` | First you want to get the list of ids from that model in a list
```
id_list = Profile.objects.filter(whaterever filter).values_list('id', flat=True).order_by('id')
```
This will return a list if integers.
Then eliminate that from your current list:
```
mylist = [{'name': 'sfsdf sdfsdf', 'id': '621205528'}, {'name'... |
6,667,210 | I have a data structure that looks like this
```
[{'name': 'sfsdf sdfsdf', 'id': '621205528'},
{'name': 'test name', 'id': '32324234234'},
{'name': 'another name', 'id': '3434535342221'}]
```
Now I have a model called Profile where the id in the dictionary maps to the uid field in the model.
I'd like to remove e... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6667210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240474/"
] | ```
ids = [x['id'] for x in my_list]
existing_ids = Profile.objects.filter(id__in=ids).values_list('id', flat=True)
result = filter(lambda elm: elm['id'] in existing_ids, my_list)
``` | First you want to get the list of ids from that model in a list
```
id_list = Profile.objects.filter(whaterever filter).values_list('id', flat=True).order_by('id')
```
This will return a list if integers.
Then eliminate that from your current list:
```
mylist = [{'name': 'sfsdf sdfsdf', 'id': '621205528'}, {'name'... |
25,939,273 | I noticed that while I was playing a video on YouTube (in Chrome), an HTML5 game that I'm developing with CreateJS was running half the framerate it usually does.
By itself, on desktop - no problem at running *60fps*.
With the YouTube video running? *30fps!*
Odd thing is, I can't seem to reproduce the issue on a dif... | 2014/09/19 | [
"https://Stackoverflow.com/questions/25939273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/468206/"
] | Oracle [Java SE Embedded](http://www.oracle.com/technetwork/java/embedded/embedded-se/overview/index.html) and Oracle [Java ME Embedded](http://www.oracle.com/technetwork/java/embedded/javame/embed-me/overview/index.html) are both Oracle products. Since I'm just an engineer (and this is StackOverflow) I'll confine my c... | exactly as Stuart says you can find the same in java oracle se embedded FAQ : Q: How does it differ from Java ME?
Java ME and Java SE Embedded address different segments of the embedded market. The Java ME CLDC and CDC offerings are designed for resource-limited devices including cell phones, handsets and media player... |
51,426 | I have read many novels and found that the writers do not follow basic phrase structure rules while constructing a sentence. For example, they may write a sentence with only one word like "Fear" And sometimes, they may come up with a compound sentence made up of imperative and interrogative.
Is this allowed, or should... | 2020/06/05 | [
"https://writers.stackexchange.com/questions/51426",
"https://writers.stackexchange.com",
"https://writers.stackexchange.com/users/44592/"
] | *The purpose of all writing is to communicate.* The target of the writing may be the author (to write is to think, to think is to write), a few people, or the masses. The time frame may be the-things-to-do-this-afternoon or timeless philosophy. But it is always to communicate.
What has to be in place for that to happe... | It’s not necessary, but breaking conventional grammar rules can be a good tool depending on how it’s applied.
For example, if a story is written in the first person and stream-of thought-narration is used, using sentence fragments or run-on sentences at certain points could give the readers a better understanding of ... |
51,426 | I have read many novels and found that the writers do not follow basic phrase structure rules while constructing a sentence. For example, they may write a sentence with only one word like "Fear" And sometimes, they may come up with a compound sentence made up of imperative and interrogative.
Is this allowed, or should... | 2020/06/05 | [
"https://writers.stackexchange.com/questions/51426",
"https://writers.stackexchange.com",
"https://writers.stackexchange.com/users/44592/"
] | *The purpose of all writing is to communicate.* The target of the writing may be the author (to write is to think, to think is to write), a few people, or the masses. The time frame may be the-things-to-do-this-afternoon or timeless philosophy. But it is always to communicate.
What has to be in place for that to happe... | When did grammar rules and 'phrase structure' rules become the same?
The correct answer is no, a writer does not have to follow perfect English per some English dept or professor, nor from any handbook that has no official status and of which there are many that do not all agree.
What the writer needs to do is be cle... |
51,426 | I have read many novels and found that the writers do not follow basic phrase structure rules while constructing a sentence. For example, they may write a sentence with only one word like "Fear" And sometimes, they may come up with a compound sentence made up of imperative and interrogative.
Is this allowed, or should... | 2020/06/05 | [
"https://writers.stackexchange.com/questions/51426",
"https://writers.stackexchange.com",
"https://writers.stackexchange.com/users/44592/"
] | It’s not necessary, but breaking conventional grammar rules can be a good tool depending on how it’s applied.
For example, if a story is written in the first person and stream-of thought-narration is used, using sentence fragments or run-on sentences at certain points could give the readers a better understanding of ... | When did grammar rules and 'phrase structure' rules become the same?
The correct answer is no, a writer does not have to follow perfect English per some English dept or professor, nor from any handbook that has no official status and of which there are many that do not all agree.
What the writer needs to do is be cle... |
12,197 | My friend claims that one could reduce the number of states of a given turning machine by somehow blowing up the tape alphabet. He does not have any algorithm though. He only has the intuition.
But I say it's not possible. Else one could arbitrarily keep decreasing the states via the same algorithm and arrive at some ... | 2010/11/28 | [
"https://math.stackexchange.com/questions/12197",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Yes it is possible to reduce the number of states a Turing machine uses to decide a problem $X$ by increasing the number of symbols.
However it gets very tricky when you are close to the *minimum number* of states/symbols needed to solve $X$
Here is a nice survey paper about the efforts to find the minimum number of ... | I think this in the same vein as creating a compression algorithm that will compress any given file, i.e. than we can compress the output again and again, until we reach a single bit that will represent all possible files. Yet, compression algorithms do exist, and they do compress **some** files.
So, even it the numbe... |
55,322,863 | I have completely Clear Excel File. it has 5 MB size I can't find a problem. I have the same problem with a work-related file.
<https://ufile.io/xsvqd>
On the link, you can download the file. | 2019/03/24 | [
"https://Stackoverflow.com/questions/55322863",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8763275/"
] | You need to use ServerWebExchange.
```
@PostMapping(value = "webclient/rest6", consumes = {"application/x-www-form-urlencoded"})
public Mono<String> redirectComplete(ServerWebExchange exchange) {
Mono<MultiValueMap<String, String>> data = exchange.getFormData();
return data.map(formData -> {
String pa... | Your *postWithFormData()* code is OK.
The problem is in your *rest4(..)* method. You can't use *@RequestParam* annotation in order to get POST parameter (it should be used to get GET parameters).
You can use DTO instead. If you change the code this way it should work:
```
@PostMapping(value = "rest4")
public Res... |
14,093,232 | I've built a model called "Subject" in my Rails 3.2 application. I used the scaffold command below.
```
rails g scaffold Subject subject singular:boolean gender:integer subject_masculine subject_feminine subject_neuter language:references --skip-stylesheets
```
The scaffold runs almost to the end, but then gives a m... | 2012/12/30 | [
"https://Stackoverflow.com/questions/14093232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/993592/"
] | As stated in the documentation (and noticed by AJcodez), there is a solution in creating a dedicated column for tsvector index. Then define a trigger that catches insertions to index urls properly:
```
CREATE test_url (url varchar NOT NULL, url_tsvector tsvector NOT NULL);
```
This method will transorm any non alpha... | I ended up modifying the [pg\_search](https://github.com/Casecommons/pg_search) gem to support arbitrary ts\_vector expressions instead of just column names.
The changes are [here](https://github.com/mihaifm/pg_search/commit/8026c102156f670dd1a9779da5acf5686c345588)
Now I can write:
```
pg_search_scope :search,
... |
14,093,232 | I've built a model called "Subject" in my Rails 3.2 application. I used the scaffold command below.
```
rails g scaffold Subject subject singular:boolean gender:integer subject_masculine subject_feminine subject_neuter language:references --skip-stylesheets
```
The scaffold runs almost to the end, but then gives a m... | 2012/12/30 | [
"https://Stackoverflow.com/questions/14093232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/993592/"
] | As stated in the documentation (and noticed by AJcodez), there is a solution in creating a dedicated column for tsvector index. Then define a trigger that catches insertions to index urls properly:
```
CREATE test_url (url varchar NOT NULL, url_tsvector tsvector NOT NULL);
```
This method will transorm any non alpha... | Slightly simpler approach, add the protocol token type to the `simple` dictionary:
```
ALTER TEXT SEARCH CONFIGURATION simple
ADD MAPPING FOR protocol
WITH simple;
```
you can also add it to the `english` dictionary if you need stemming
<https://www.postgresql.org/docs/13/textsearch-parsers.html>
<http... |
14,093,232 | I've built a model called "Subject" in my Rails 3.2 application. I used the scaffold command below.
```
rails g scaffold Subject subject singular:boolean gender:integer subject_masculine subject_feminine subject_neuter language:references --skip-stylesheets
```
The scaffold runs almost to the end, but then gives a m... | 2012/12/30 | [
"https://Stackoverflow.com/questions/14093232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/993592/"
] | I ended up modifying the [pg\_search](https://github.com/Casecommons/pg_search) gem to support arbitrary ts\_vector expressions instead of just column names.
The changes are [here](https://github.com/mihaifm/pg_search/commit/8026c102156f670dd1a9779da5acf5686c345588)
Now I can write:
```
pg_search_scope :search,
... | Slightly simpler approach, add the protocol token type to the `simple` dictionary:
```
ALTER TEXT SEARCH CONFIGURATION simple
ADD MAPPING FOR protocol
WITH simple;
```
you can also add it to the `english` dictionary if you need stemming
<https://www.postgresql.org/docs/13/textsearch-parsers.html>
<http... |
46,394,659 | I want to use the histogram of the output from a CNN to compute the loss. I am wondering whether `tf.histogram_fixed_width()` supports the gradient to flow back to its former layer. Only it works, I can add a loss layer after calculating the histogram. | 2017/09/24 | [
"https://Stackoverflow.com/questions/46394659",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8666472/"
] | `tf.histogram_fixed_width()` does not support autogradient functionality since histogram is not a continuous differential function. You can look at the following example which returns gradient None.
```
import keras.backend as K
import tensorflow as tf
value_range = [0.0, 5.0]
a = np.array([-1.0, 0.0, 1.5, 2.0, 5.0, ... | I had the similar problem. There are two ways you can try: 1. After the output layer, add an extra layer to produce the histogram; 2. Use something like `tf.RegisterGradient` or `tf.custom_gradient` to define your own gradients for the operations. |
46,394,659 | I want to use the histogram of the output from a CNN to compute the loss. I am wondering whether `tf.histogram_fixed_width()` supports the gradient to flow back to its former layer. Only it works, I can add a loss layer after calculating the histogram. | 2017/09/24 | [
"https://Stackoverflow.com/questions/46394659",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8666472/"
] | `tf.histogram_fixed_width()` does not support autogradient functionality since histogram is not a continuous differential function. You can look at the following example which returns gradient None.
```
import keras.backend as K
import tensorflow as tf
value_range = [0.0, 5.0]
a = np.array([-1.0, 0.0, 1.5, 2.0, 5.0, ... | If someone is looking for a solution:
As Stephen mentioned, a histogram isn't a continuous function (or even mostly continuous), so it's not differentiable. However, what you're probably looking for is actually a density estimate for the distribution of intensities. You can calculate one using kernel density estimatio... |
54,666,441 | I'm having a fairly large dataset where I need to combine multiple entries into a single value. My dataset contains data on the combination of two datasets, each using their own ID's and keys.
I thought of using a `Sumproduct()` function like this:
`=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--('Raw data'!O:O={20;... | 2019/02/13 | [
"https://Stackoverflow.com/questions/54666441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1481116/"
] | I want to give a shot to this question, after asking OP for some clarifications, because English is not my main language and I think I have misunderstood something.
So, what I did to simulate situation, made a new workbook with 2 sheets.
One sheet is named `Landgebruik` and got a value in `A2` and I did this:
[![ent... | This could work:
```
={SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--IFERROR(MATCH('Raw data'!O:O;{20;21;22;23;40};0)>0;0);'Raw data'!S:S)}
```
This needs to be entered as an array formula. |
54,666,441 | I'm having a fairly large dataset where I need to combine multiple entries into a single value. My dataset contains data on the combination of two datasets, each using their own ID's and keys.
I thought of using a `Sumproduct()` function like this:
`=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--('Raw data'!O:O={20;... | 2019/02/13 | [
"https://Stackoverflow.com/questions/54666441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1481116/"
] | You can use text search for this:
```
--NOT(ISERROR(FIND('Raw data'!O:O,"2021222340")))
```
But you have to be careful that a shorter ID is not found incorrectly in a longer ID, e.g. if you want to search among the IDs { 123, 456, 789 } then 12 is not considered to be among the IDs. So a simple text search like the ... | If you are interested in performance (calculation speed) and are not afraid of matrix calculation, you can use MMULT:
```
=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2),MMULT(--('Raw data'!O:O={20,21,22,23,24}),TRANSPOSE({1,1,1,1,1})),'Raw data'!S:S)
```
Explanation:
First, you create a 1048576×5 matrix, where the v... |
54,666,441 | I'm having a fairly large dataset where I need to combine multiple entries into a single value. My dataset contains data on the combination of two datasets, each using their own ID's and keys.
I thought of using a `Sumproduct()` function like this:
`=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--('Raw data'!O:O={20;... | 2019/02/13 | [
"https://Stackoverflow.com/questions/54666441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1481116/"
] | You could make a small change to your current formula; change the `;` to `*` (`--` are also unneeded in that particular case):
```
=SUMPRODUCT(('Raw data'!C:C=Landgebruik!A2)*('Raw data'!O:O={20;21;22;23;40})*'Raw data'!S:S)
```
And that should work.
---
When you feed separate parameters to `SUMPRODUCT`, each par... | This could work:
```
={SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--IFERROR(MATCH('Raw data'!O:O;{20;21;22;23;40};0)>0;0);'Raw data'!S:S)}
```
This needs to be entered as an array formula. |
54,666,441 | I'm having a fairly large dataset where I need to combine multiple entries into a single value. My dataset contains data on the combination of two datasets, each using their own ID's and keys.
I thought of using a `Sumproduct()` function like this:
`=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--('Raw data'!O:O={20;... | 2019/02/13 | [
"https://Stackoverflow.com/questions/54666441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1481116/"
] | Even though this has been done hundreds of times before, hey maybe microsoft switched up the formulas or something.
I am partial to the method Jerry and Me suggested as they are simple as hell and concise, but you pay a heavy performance cost.
Tom's formula looks ugly to me but was fastest by far, about 4x faster tha... | If you are interested in performance (calculation speed) and are not afraid of matrix calculation, you can use MMULT:
```
=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2),MMULT(--('Raw data'!O:O={20,21,22,23,24}),TRANSPOSE({1,1,1,1,1})),'Raw data'!S:S)
```
Explanation:
First, you create a 1048576×5 matrix, where the v... |
54,666,441 | I'm having a fairly large dataset where I need to combine multiple entries into a single value. My dataset contains data on the combination of two datasets, each using their own ID's and keys.
I thought of using a `Sumproduct()` function like this:
`=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--('Raw data'!O:O={20;... | 2019/02/13 | [
"https://Stackoverflow.com/questions/54666441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1481116/"
] | You could split it into two SUMIFS as mentioned in the comment. If all values are integers, then comparing 'Raw data'!O:O to 20,21,22 and 23 is the same as testing it for >=20 and <=23. The value 40 has to be done separately.
```
=SUMIFS('Raw Data'!S:S,'Raw Data'!C:C,Landgebruik!A2,'Raw Data'!O:O,">="&20,'Raw Data'!O:... | If you are interested in performance (calculation speed) and are not afraid of matrix calculation, you can use MMULT:
```
=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2),MMULT(--('Raw data'!O:O={20,21,22,23,24}),TRANSPOSE({1,1,1,1,1})),'Raw data'!S:S)
```
Explanation:
First, you create a 1048576×5 matrix, where the v... |
54,666,441 | I'm having a fairly large dataset where I need to combine multiple entries into a single value. My dataset contains data on the combination of two datasets, each using their own ID's and keys.
I thought of using a `Sumproduct()` function like this:
`=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--('Raw data'!O:O={20;... | 2019/02/13 | [
"https://Stackoverflow.com/questions/54666441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1481116/"
] | You could make a small change to your current formula; change the `;` to `*` (`--` are also unneeded in that particular case):
```
=SUMPRODUCT(('Raw data'!C:C=Landgebruik!A2)*('Raw data'!O:O={20;21;22;23;40})*'Raw data'!S:S)
```
And that should work.
---
When you feed separate parameters to `SUMPRODUCT`, each par... | You can use text search for this:
```
--NOT(ISERROR(FIND('Raw data'!O:O,"2021222340")))
```
But you have to be careful that a shorter ID is not found incorrectly in a longer ID, e.g. if you want to search among the IDs { 123, 456, 789 } then 12 is not considered to be among the IDs. So a simple text search like the ... |
54,666,441 | I'm having a fairly large dataset where I need to combine multiple entries into a single value. My dataset contains data on the combination of two datasets, each using their own ID's and keys.
I thought of using a `Sumproduct()` function like this:
`=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--('Raw data'!O:O={20;... | 2019/02/13 | [
"https://Stackoverflow.com/questions/54666441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1481116/"
] | You could split it into two SUMIFS as mentioned in the comment. If all values are integers, then comparing 'Raw data'!O:O to 20,21,22 and 23 is the same as testing it for >=20 and <=23. The value 40 has to be done separately.
```
=SUMIFS('Raw Data'!S:S,'Raw Data'!C:C,Landgebruik!A2,'Raw Data'!O:O,">="&20,'Raw Data'!O:... | This could work:
```
={SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--IFERROR(MATCH('Raw data'!O:O;{20;21;22;23;40};0)>0;0);'Raw data'!S:S)}
```
This needs to be entered as an array formula. |
54,666,441 | I'm having a fairly large dataset where I need to combine multiple entries into a single value. My dataset contains data on the combination of two datasets, each using their own ID's and keys.
I thought of using a `Sumproduct()` function like this:
`=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--('Raw data'!O:O={20;... | 2019/02/13 | [
"https://Stackoverflow.com/questions/54666441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1481116/"
] | You can use text search for this:
```
--NOT(ISERROR(FIND('Raw data'!O:O,"2021222340")))
```
But you have to be careful that a shorter ID is not found incorrectly in a longer ID, e.g. if you want to search among the IDs { 123, 456, 789 } then 12 is not considered to be among the IDs. So a simple text search like the ... | I want to give a shot to this question, after asking OP for some clarifications, because English is not my main language and I think I have misunderstood something.
So, what I did to simulate situation, made a new workbook with 2 sheets.
One sheet is named `Landgebruik` and got a value in `A2` and I did this:
[![ent... |
54,666,441 | I'm having a fairly large dataset where I need to combine multiple entries into a single value. My dataset contains data on the combination of two datasets, each using their own ID's and keys.
I thought of using a `Sumproduct()` function like this:
`=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--('Raw data'!O:O={20;... | 2019/02/13 | [
"https://Stackoverflow.com/questions/54666441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1481116/"
] | You could make a small change to your current formula; change the `;` to `*` (`--` are also unneeded in that particular case):
```
=SUMPRODUCT(('Raw data'!C:C=Landgebruik!A2)*('Raw data'!O:O={20;21;22;23;40})*'Raw data'!S:S)
```
And that should work.
---
When you feed separate parameters to `SUMPRODUCT`, each par... | Even though this has been done hundreds of times before, hey maybe microsoft switched up the formulas or something.
I am partial to the method Jerry and Me suggested as they are simple as hell and concise, but you pay a heavy performance cost.
Tom's formula looks ugly to me but was fastest by far, about 4x faster tha... |
54,666,441 | I'm having a fairly large dataset where I need to combine multiple entries into a single value. My dataset contains data on the combination of two datasets, each using their own ID's and keys.
I thought of using a `Sumproduct()` function like this:
`=SUMPRODUCT(--('Raw data'!C:C=Landgebruik!A2);--('Raw data'!O:O={20;... | 2019/02/13 | [
"https://Stackoverflow.com/questions/54666441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1481116/"
] | You could split it into two SUMIFS as mentioned in the comment. If all values are integers, then comparing 'Raw data'!O:O to 20,21,22 and 23 is the same as testing it for >=20 and <=23. The value 40 has to be done separately.
```
=SUMIFS('Raw Data'!S:S,'Raw Data'!C:C,Landgebruik!A2,'Raw Data'!O:O,">="&20,'Raw Data'!O:... | I want to give a shot to this question, after asking OP for some clarifications, because English is not my main language and I think I have misunderstood something.
So, what I did to simulate situation, made a new workbook with 2 sheets.
One sheet is named `Landgebruik` and got a value in `A2` and I did this:
[![ent... |
35,008,126 | I currently I have a model like this-
```
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class UserSlidePhoto extends Model
{
protected $table="users_slides_photos";
protected $fillable=['user_id','social_image_id','original_image_name','provider_key','provider_id','thumbnail_name'];
publ... | 2016/01/26 | [
"https://Stackoverflow.com/questions/35008126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2193439/"
] | You have bad query, just run it to see that it return only one row per each month.
So you need to remove **group\_by** clause and do it manually in PHP or use [laravel collections](https://laravel.com/docs/5.1/collections#method-groupby) | A `group by` will only give you one row per month.
Unless there is some eloquent magic I don't know yet (Which is quite probably true), you'll have to parse the array via PHP to organize your data. |
35,008,126 | I currently I have a model like this-
```
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class UserSlidePhoto extends Model
{
protected $table="users_slides_photos";
protected $fillable=['user_id','social_image_id','original_image_name','provider_key','provider_id','thumbnail_name'];
publ... | 2016/01/26 | [
"https://Stackoverflow.com/questions/35008126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2193439/"
] | I have solved it like this way-
```
public function rearrangePhotoMonth(Request $request)
{
//$ordering = $request->input('ordering');
$thumbs = url('/uploads/userfiles/thumbs/')."/";
$images = url('/uploads/userfiles/images/')."/";
$collection = UserSlidePhoto::where('user_id', Auth::id())
... | A `group by` will only give you one row per month.
Unless there is some eloquent magic I don't know yet (Which is quite probably true), you'll have to parse the array via PHP to organize your data. |
35,008,126 | I currently I have a model like this-
```
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class UserSlidePhoto extends Model
{
protected $table="users_slides_photos";
protected $fillable=['user_id','social_image_id','original_image_name','provider_key','provider_id','thumbnail_name'];
publ... | 2016/01/26 | [
"https://Stackoverflow.com/questions/35008126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2193439/"
] | I have solved it like this way-
```
public function rearrangePhotoMonth(Request $request)
{
//$ordering = $request->input('ordering');
$thumbs = url('/uploads/userfiles/thumbs/')."/";
$images = url('/uploads/userfiles/images/')."/";
$collection = UserSlidePhoto::where('user_id', Auth::id())
... | You have bad query, just run it to see that it return only one row per each month.
So you need to remove **group\_by** clause and do it manually in PHP or use [laravel collections](https://laravel.com/docs/5.1/collections#method-groupby) |
53,710,218 | According to my understanding, every object has a lock that can be hold by the current thread.
So, based on this example:
```
public class T1 {
private final Object o = new Object();
public void m1() {
synchronized(o) {
//...wait some time
}
}
}
```
If I create something li... | 2018/12/10 | [
"https://Stackoverflow.com/questions/53710218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3044117/"
] | In your example, you are running the two method sequentially in the same thread. To execute them in parallel, you must run them in separate threads.
```
T1 subject1 = new T1();
T1 subject2 = new T1();
Runnable r1 = new Runnable() {
@Override
public void run() {
subject2.m1();
}
};
Runnable r2 = n... | >
> There will be two locks, `subject1.o` and `subject2.o` (I tested they
> are different instances), which means *both methods will run
> independently* and at the same time
>
>
>
You say both methods will run independently though you have only one enclosing method to run both threads. Instead, both methods hav... |
53,710,218 | According to my understanding, every object has a lock that can be hold by the current thread.
So, based on this example:
```
public class T1 {
private final Object o = new Object();
public void m1() {
synchronized(o) {
//...wait some time
}
}
}
```
If I create something li... | 2018/12/10 | [
"https://Stackoverflow.com/questions/53710218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3044117/"
] | >
> There will be two locks, `subject1.o` and `subject2.o` ..., which means both methods will run independently and at the same time.
>
>
>
No. The fact that there are two locks does *not* mean that two calls to the `m1` function will run independently and at the same time. It only means that two calls *can* run a... | >
> There will be two locks, `subject1.o` and `subject2.o` (I tested they
> are different instances), which means *both methods will run
> independently* and at the same time
>
>
>
You say both methods will run independently though you have only one enclosing method to run both threads. Instead, both methods hav... |
54,388,712 | So after I hide first element( the main menu ) I show another menu with inputs and two buttons ( Play and Return ). When I click return I want to go back to the main menu( first element ) but show() and hide() doesn't work anymore and I can't figure out why. I want to make this app in Electron, but I tried on web brows... | 2019/01/27 | [
"https://Stackoverflow.com/questions/54388712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10566567/"
] | In the below function, the third clause is unreachable (you're only attaching click events to `AIbtn` and `PVPbtn`, so `this.id` can never be `returnBTN`.)
```
$('#AIbtn, #PVPbtn').click(function() {
if (this.id == 'AIbtn') {
show_ai_menu();
} else if (this.id == 'PVPbtn') {
show_pvp_menu();
} else if... | Like Ashay said, show does not have a signature that match your usage.
See the doc : <http://api.jquery.com/show/>
If you want to execute your code when the animation is complete, you can
`$(...).show({complete: function myCompleteCallback() {...} })`
or
`$(...).show(400 /* duration*/,function myCompleteCallback() ... |
5,663,033 | So I'm trying to load dynamic content straight into my checkbox container (group\_checkboxes)
```
<div id='group_checkboxes' data-role="fieldcontain">
</div>
```
This is the statement I'm running to populate the container:
```
$('#group_checkboxes').append('<fieldset data-role="controlgroup"><input type="checkbox"... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5663033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706148/"
] | First try their own static demo code:
```
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<legend>Choose as many snacks as you'd like:</legend>
<input type="checkbox" name="checkbox-1a" id="checkbox-1a" class="custom" />
<l... | try
```
$('input:checkbox').checkboxradio('refresh');
``` |
5,663,033 | So I'm trying to load dynamic content straight into my checkbox container (group\_checkboxes)
```
<div id='group_checkboxes' data-role="fieldcontain">
</div>
```
This is the statement I'm running to populate the container:
```
$('#group_checkboxes').append('<fieldset data-role="controlgroup"><input type="checkbox"... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5663033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706148/"
] | First try their own static demo code:
```
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<legend>Choose as many snacks as you'd like:</legend>
<input type="checkbox" name="checkbox-1a" id="checkbox-1a" class="custom" />
<l... | What work out for me was to remove the whole fieldset then replace place a new fieldset with the new item I wanted to add then I called the `.trigger('pagecreate');` method on the whole page. This is not the most efficient solution but that is the only one that worked in my case. |
5,663,033 | So I'm trying to load dynamic content straight into my checkbox container (group\_checkboxes)
```
<div id='group_checkboxes' data-role="fieldcontain">
</div>
```
This is the statement I'm running to populate the container:
```
$('#group_checkboxes').append('<fieldset data-role="controlgroup"><input type="checkbox"... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5663033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706148/"
] | ```
<!DOCTYPE HTML>
<html>
<head>
<title>checkbox</title>
<link rel="stylesheet" href="jQuery/css/jquery.mobile-1.0a4.1.min.css" />
<script type="text/javascript" src="jQuery/js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="jQuery/js/jquery.mobile-1.0... | What work out for me was to remove the whole fieldset then replace place a new fieldset with the new item I wanted to add then I called the `.trigger('pagecreate');` method on the whole page. This is not the most efficient solution but that is the only one that worked in my case. |
5,663,033 | So I'm trying to load dynamic content straight into my checkbox container (group\_checkboxes)
```
<div id='group_checkboxes' data-role="fieldcontain">
</div>
```
This is the statement I'm running to populate the container:
```
$('#group_checkboxes').append('<fieldset data-role="controlgroup"><input type="checkbox"... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5663033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706148/"
] | When appending checkboxes or radio buttons to a *controlgroup* dynamically, you deal with two jQuery Mobile widgets, `.checkboxradio()` and `.controlgroup()`.
Both should be created/updated/enhanced/styled with jQuery Mobile CSS once new elements are added.
The way to achieve this is different in latest stable versio... | ```
<!DOCTYPE HTML>
<html>
<head>
<title>checkbox</title>
<link rel="stylesheet" href="jQuery/css/jquery.mobile-1.0a4.1.min.css" />
<script type="text/javascript" src="jQuery/js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="jQuery/js/jquery.mobile-1.0... |
5,663,033 | So I'm trying to load dynamic content straight into my checkbox container (group\_checkboxes)
```
<div id='group_checkboxes' data-role="fieldcontain">
</div>
```
This is the statement I'm running to populate the container:
```
$('#group_checkboxes').append('<fieldset data-role="controlgroup"><input type="checkbox"... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5663033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706148/"
] | When appending checkboxes or radio buttons to a *controlgroup* dynamically, you deal with two jQuery Mobile widgets, `.checkboxradio()` and `.controlgroup()`.
Both should be created/updated/enhanced/styled with jQuery Mobile CSS once new elements are added.
The way to achieve this is different in latest stable versio... | try
```
$('input:checkbox').checkboxradio('refresh');
``` |
5,663,033 | So I'm trying to load dynamic content straight into my checkbox container (group\_checkboxes)
```
<div id='group_checkboxes' data-role="fieldcontain">
</div>
```
This is the statement I'm running to populate the container:
```
$('#group_checkboxes').append('<fieldset data-role="controlgroup"><input type="checkbox"... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5663033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706148/"
] | try with `$("#<id of fieldset controlgroup>").trigger("create");`
<http://jsfiddle.net/YKvR3/36/> | ```
<!DOCTYPE HTML>
<html>
<head>
<title>checkbox</title>
<link rel="stylesheet" href="jQuery/css/jquery.mobile-1.0a4.1.min.css" />
<script type="text/javascript" src="jQuery/js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="jQuery/js/jquery.mobile-1.0... |
5,663,033 | So I'm trying to load dynamic content straight into my checkbox container (group\_checkboxes)
```
<div id='group_checkboxes' data-role="fieldcontain">
</div>
```
This is the statement I'm running to populate the container:
```
$('#group_checkboxes').append('<fieldset data-role="controlgroup"><input type="checkbox"... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5663033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706148/"
] | When appending checkboxes or radio buttons to a *controlgroup* dynamically, you deal with two jQuery Mobile widgets, `.checkboxradio()` and `.controlgroup()`.
Both should be created/updated/enhanced/styled with jQuery Mobile CSS once new elements are added.
The way to achieve this is different in latest stable versio... | try with `$("#<id of fieldset controlgroup>").trigger("create");`
<http://jsfiddle.net/YKvR3/36/> |
5,663,033 | So I'm trying to load dynamic content straight into my checkbox container (group\_checkboxes)
```
<div id='group_checkboxes' data-role="fieldcontain">
</div>
```
This is the statement I'm running to populate the container:
```
$('#group_checkboxes').append('<fieldset data-role="controlgroup"><input type="checkbox"... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5663033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706148/"
] | When appending checkboxes or radio buttons to a *controlgroup* dynamically, you deal with two jQuery Mobile widgets, `.checkboxradio()` and `.controlgroup()`.
Both should be created/updated/enhanced/styled with jQuery Mobile CSS once new elements are added.
The way to achieve this is different in latest stable versio... | What work out for me was to remove the whole fieldset then replace place a new fieldset with the new item I wanted to add then I called the `.trigger('pagecreate');` method on the whole page. This is not the most efficient solution but that is the only one that worked in my case. |
5,663,033 | So I'm trying to load dynamic content straight into my checkbox container (group\_checkboxes)
```
<div id='group_checkboxes' data-role="fieldcontain">
</div>
```
This is the statement I'm running to populate the container:
```
$('#group_checkboxes').append('<fieldset data-role="controlgroup"><input type="checkbox"... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5663033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706148/"
] | try
```
$('input:checkbox').checkboxradio('refresh');
``` | What work out for me was to remove the whole fieldset then replace place a new fieldset with the new item I wanted to add then I called the `.trigger('pagecreate');` method on the whole page. This is not the most efficient solution but that is the only one that worked in my case. |
5,663,033 | So I'm trying to load dynamic content straight into my checkbox container (group\_checkboxes)
```
<div id='group_checkboxes' data-role="fieldcontain">
</div>
```
This is the statement I'm running to populate the container:
```
$('#group_checkboxes').append('<fieldset data-role="controlgroup"><input type="checkbox"... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5663033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706148/"
] | try with `$("#<id of fieldset controlgroup>").trigger("create");`
<http://jsfiddle.net/YKvR3/36/> | try
```
$('input:checkbox').checkboxradio('refresh');
``` |
27,771,941 | I am trying to add weeks in decimal values like 1.5, 2.5 to date through strtotime() function. But its not giving correct result. I am using it like:
```
$start_date = "2015-01-01";
$date = strtotime(date("Y-m-d", strtotime($start_date)) . " +3.5 weeks");
$date = date("Y-m-d",$date);
echo $date;
```
And its givin... | 2015/01/05 | [
"https://Stackoverflow.com/questions/27771941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Actually, java enums are a pretty handy object.
You can add properties, even methods, if you want. To assign properties, just add the value as an argument to the contructor as in:
```
public enum AccessType {
Full(0),
ReadOnly(1),
Delete(2),
Add(3);
private final int code;
AccessType(int code)... | Please have a look at this page from Oracle: <http://docs.oracle.com/javase/tutorial/java/javaOO/enum.html>
You would have something like this for your ENUM (code untested):
```
public enum AccessType
{
Full(0),
ReadOnly(1),
Delete(2),
Add(3);
AccessType(int type)
{
this.type = type;
... |
3,456,535 | Show that $\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=0$ is divisible by $\lambda^2$ and find the other factor.
My attempt is as follows:-
$$R\_1\rightarrow R\_1+R\_2+R\_3$$
$$\begin{vmatrix}
a(a+b+c)+\lambda &b(a+b+c)+\lambda &c(a+b+c)+\lambda \\
ab & b^2+\... | 2019/11/30 | [
"https://math.stackexchange.com/questions/3456535",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/278972/"
] | I did not go all the way, but the first (maybe the only) mistake is in the $C\_1\rightarrow C\_1-\dfrac{a}{b}C\_2$ step. The second row will be $$ab-\frac ab(b^2+\lambda)=ab-ab-\frac ab\lambda=-\frac ab\lambda\ne-\lambda$$ | Alternatively:
$$\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=
\begin{vmatrix}
a^2 &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}+
\begin{vmatrix}
\lambda&ab&ac \\
0 & b^2+\lambda & bc \\
0 & bc & c^2+\lambda
\end{vmatrix}=\\
a^2\begin{v... |
3,456,535 | Show that $\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=0$ is divisible by $\lambda^2$ and find the other factor.
My attempt is as follows:-
$$R\_1\rightarrow R\_1+R\_2+R\_3$$
$$\begin{vmatrix}
a(a+b+c)+\lambda &b(a+b+c)+\lambda &c(a+b+c)+\lambda \\
ab & b^2+\... | 2019/11/30 | [
"https://math.stackexchange.com/questions/3456535",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/278972/"
] | Let me give you a much simpler solution, using the general fact that if $B$ is a square matrix of rank $1$, then $\det({\rm Id}\_n+B) = 1+{\rm tr}(B)$. Let $A$ be the matrix you want to compute the determinant of. Then if $v = [a ~ b ~c]^\top$, we have that $A = \lambda{\rm Id}\_3 + vv^\top$. This means that $$\begin{a... | The determinant in your problem is equal to $p(-\lambda),$ where $p$ is the characteristic polynomial of $A = vv^T,$ where $ v = [a, \ b, \ c]^T.$ The $0$-eigenspace (i.e, the kernel of $A$) is the two dimensional hyperplane given by $v^Tx = 0,$ so $0$ is an eigenvalue with algebraic multiplicity at least two and the f... |
3,456,535 | Show that $\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=0$ is divisible by $\lambda^2$ and find the other factor.
My attempt is as follows:-
$$R\_1\rightarrow R\_1+R\_2+R\_3$$
$$\begin{vmatrix}
a(a+b+c)+\lambda &b(a+b+c)+\lambda &c(a+b+c)+\lambda \\
ab & b^2+\... | 2019/11/30 | [
"https://math.stackexchange.com/questions/3456535",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/278972/"
] | Finally solved it.
Thanks to all for looking into this problem, special thanks to @Andrei for pointing out the exact mistake.
$$C\_1\rightarrow C\_1-\dfrac{a}{b}C\_2$$
$$C\_2\rightarrow C\_2-\dfrac{b}{c}C\_3$$
$$\begin{vmatrix}
\lambda-\dfrac{a\lambda}{b}&\lambda-\dfrac{b\lambda}{c} &c(a+b+c)+\lambda \\
-\dfrac{a\la... | Alternatively:
$$\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=
\begin{vmatrix}
a^2 &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}+
\begin{vmatrix}
\lambda&ab&ac \\
0 & b^2+\lambda & bc \\
0 & bc & c^2+\lambda
\end{vmatrix}=\\
a^2\begin{v... |
3,456,535 | Show that $\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=0$ is divisible by $\lambda^2$ and find the other factor.
My attempt is as follows:-
$$R\_1\rightarrow R\_1+R\_2+R\_3$$
$$\begin{vmatrix}
a(a+b+c)+\lambda &b(a+b+c)+\lambda &c(a+b+c)+\lambda \\
ab & b^2+\... | 2019/11/30 | [
"https://math.stackexchange.com/questions/3456535",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/278972/"
] | I did not go all the way, but the first (maybe the only) mistake is in the $C\_1\rightarrow C\_1-\dfrac{a}{b}C\_2$ step. The second row will be $$ab-\frac ab(b^2+\lambda)=ab-ab-\frac ab\lambda=-\frac ab\lambda\ne-\lambda$$ | The determinant in your problem is equal to $p(-\lambda),$ where $p$ is the characteristic polynomial of $A = vv^T,$ where $ v = [a, \ b, \ c]^T.$ The $0$-eigenspace (i.e, the kernel of $A$) is the two dimensional hyperplane given by $v^Tx = 0,$ so $0$ is an eigenvalue with algebraic multiplicity at least two and the f... |
3,456,535 | Show that $\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=0$ is divisible by $\lambda^2$ and find the other factor.
My attempt is as follows:-
$$R\_1\rightarrow R\_1+R\_2+R\_3$$
$$\begin{vmatrix}
a(a+b+c)+\lambda &b(a+b+c)+\lambda &c(a+b+c)+\lambda \\
ab & b^2+\... | 2019/11/30 | [
"https://math.stackexchange.com/questions/3456535",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/278972/"
] | Let me give you a much simpler solution, using the general fact that if $B$ is a square matrix of rank $1$, then $\det({\rm Id}\_n+B) = 1+{\rm tr}(B)$. Let $A$ be the matrix you want to compute the determinant of. Then if $v = [a ~ b ~c]^\top$, we have that $A = \lambda{\rm Id}\_3 + vv^\top$. This means that $$\begin{a... | Alternatively:
$$\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=
\begin{vmatrix}
a^2 &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}+
\begin{vmatrix}
\lambda&ab&ac \\
0 & b^2+\lambda & bc \\
0 & bc & c^2+\lambda
\end{vmatrix}=\\
a^2\begin{v... |
3,456,535 | Show that $\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=0$ is divisible by $\lambda^2$ and find the other factor.
My attempt is as follows:-
$$R\_1\rightarrow R\_1+R\_2+R\_3$$
$$\begin{vmatrix}
a(a+b+c)+\lambda &b(a+b+c)+\lambda &c(a+b+c)+\lambda \\
ab & b^2+\... | 2019/11/30 | [
"https://math.stackexchange.com/questions/3456535",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/278972/"
] | I did not go all the way, but the first (maybe the only) mistake is in the $C\_1\rightarrow C\_1-\dfrac{a}{b}C\_2$ step. The second row will be $$ab-\frac ab(b^2+\lambda)=ab-ab-\frac ab\lambda=-\frac ab\lambda\ne-\lambda$$ | Finally solved it.
Thanks to all for looking into this problem, special thanks to @Andrei for pointing out the exact mistake.
$$C\_1\rightarrow C\_1-\dfrac{a}{b}C\_2$$
$$C\_2\rightarrow C\_2-\dfrac{b}{c}C\_3$$
$$\begin{vmatrix}
\lambda-\dfrac{a\lambda}{b}&\lambda-\dfrac{b\lambda}{c} &c(a+b+c)+\lambda \\
-\dfrac{a\la... |
3,456,535 | Show that $\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=0$ is divisible by $\lambda^2$ and find the other factor.
My attempt is as follows:-
$$R\_1\rightarrow R\_1+R\_2+R\_3$$
$$\begin{vmatrix}
a(a+b+c)+\lambda &b(a+b+c)+\lambda &c(a+b+c)+\lambda \\
ab & b^2+\... | 2019/11/30 | [
"https://math.stackexchange.com/questions/3456535",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/278972/"
] | I did not go all the way, but the first (maybe the only) mistake is in the $C\_1\rightarrow C\_1-\dfrac{a}{b}C\_2$ step. The second row will be $$ab-\frac ab(b^2+\lambda)=ab-ab-\frac ab\lambda=-\frac ab\lambda\ne-\lambda$$ | Let me give you a much simpler solution, using the general fact that if $B$ is a square matrix of rank $1$, then $\det({\rm Id}\_n+B) = 1+{\rm tr}(B)$. Let $A$ be the matrix you want to compute the determinant of. Then if $v = [a ~ b ~c]^\top$, we have that $A = \lambda{\rm Id}\_3 + vv^\top$. This means that $$\begin{a... |
3,456,535 | Show that $\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=0$ is divisible by $\lambda^2$ and find the other factor.
My attempt is as follows:-
$$R\_1\rightarrow R\_1+R\_2+R\_3$$
$$\begin{vmatrix}
a(a+b+c)+\lambda &b(a+b+c)+\lambda &c(a+b+c)+\lambda \\
ab & b^2+\... | 2019/11/30 | [
"https://math.stackexchange.com/questions/3456535",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/278972/"
] | Finally solved it.
Thanks to all for looking into this problem, special thanks to @Andrei for pointing out the exact mistake.
$$C\_1\rightarrow C\_1-\dfrac{a}{b}C\_2$$
$$C\_2\rightarrow C\_2-\dfrac{b}{c}C\_3$$
$$\begin{vmatrix}
\lambda-\dfrac{a\lambda}{b}&\lambda-\dfrac{b\lambda}{c} &c(a+b+c)+\lambda \\
-\dfrac{a\la... | The determinant in your problem is equal to $p(-\lambda),$ where $p$ is the characteristic polynomial of $A = vv^T,$ where $ v = [a, \ b, \ c]^T.$ The $0$-eigenspace (i.e, the kernel of $A$) is the two dimensional hyperplane given by $v^Tx = 0,$ so $0$ is an eigenvalue with algebraic multiplicity at least two and the f... |
3,456,535 | Show that $\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=0$ is divisible by $\lambda^2$ and find the other factor.
My attempt is as follows:-
$$R\_1\rightarrow R\_1+R\_2+R\_3$$
$$\begin{vmatrix}
a(a+b+c)+\lambda &b(a+b+c)+\lambda &c(a+b+c)+\lambda \\
ab & b^2+\... | 2019/11/30 | [
"https://math.stackexchange.com/questions/3456535",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/278972/"
] | I got a new way to solve this question and its just beautiful:
Multiply $R\_1$ by $a$, $R\_2$ by $b$, $R\_3$ by $c$
$$\dfrac{1}{abc}\begin{vmatrix}
a^3+a\lambda&a^2b&a^2c\\
ab^2&b^3+b\lambda&b^2c\\
ac^2&bc^2&c^3+c\lambda
\end{vmatrix}$$
Taking a common from first column, b from second column, c from third column
$$... | Alternatively:
$$\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=
\begin{vmatrix}
a^2 &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}+
\begin{vmatrix}
\lambda&ab&ac \\
0 & b^2+\lambda & bc \\
0 & bc & c^2+\lambda
\end{vmatrix}=\\
a^2\begin{v... |
3,456,535 | Show that $\begin{vmatrix}
a^2+\lambda &ab &ac \\
ab & b^2+\lambda & bc \\
ac & bc & c^2+\lambda
\end{vmatrix}=0$ is divisible by $\lambda^2$ and find the other factor.
My attempt is as follows:-
$$R\_1\rightarrow R\_1+R\_2+R\_3$$
$$\begin{vmatrix}
a(a+b+c)+\lambda &b(a+b+c)+\lambda &c(a+b+c)+\lambda \\
ab & b^2+\... | 2019/11/30 | [
"https://math.stackexchange.com/questions/3456535",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/278972/"
] | I got a new way to solve this question and its just beautiful:
Multiply $R\_1$ by $a$, $R\_2$ by $b$, $R\_3$ by $c$
$$\dfrac{1}{abc}\begin{vmatrix}
a^3+a\lambda&a^2b&a^2c\\
ab^2&b^3+b\lambda&b^2c\\
ac^2&bc^2&c^3+c\lambda
\end{vmatrix}$$
Taking a common from first column, b from second column, c from third column
$$... | The determinant in your problem is equal to $p(-\lambda),$ where $p$ is the characteristic polynomial of $A = vv^T,$ where $ v = [a, \ b, \ c]^T.$ The $0$-eigenspace (i.e, the kernel of $A$) is the two dimensional hyperplane given by $v^Tx = 0,$ so $0$ is an eigenvalue with algebraic multiplicity at least two and the f... |
35,825,919 | I am parsing my vcard info (copied to a txt file)to extract `name:number` and put it into a dictionary.
Data sample:
```
BEGIN:VCARD
VERSION:2.1
N:MEO;Apoio;;;
FN:Apoio MEO
TEL;CELL;PREF:1696
TEL;CELL:162 00
END:VCARD
BEGIN:VCARD
VERSION:2.1
N:estrangeiro;Apoio MEO;no;;
FN:Apoio MEO no estrangeir... | 2016/03/06 | [
"https://Stackoverflow.com/questions/35825919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5764486/"
] | You should better use an already [existing library](https://pypi.python.org/pypi/vobject/) instead of trying to reinvent the wheel:
```
pip install vobject
```
And then within python
```
>>> import vobject
>>> s = """\
... BEGIN:VCARD
... VERSION:2.1
... N:MEO;Apoio;;;
... FN:Apoio MEO
... TEL;CELL;PREF:0123456789
... | My answer is based on zmos answer (you need to install vobject).
To get all vobjects from a vcf-file you can do something like this:
```
import vobject
with open(infile) as inf:
indata = inf.read()
vc = vobject.readComponents(indata)
vo = next(vc, None)
while vo is not None:
vo.prettyPrint()
... |
308,777 | I'm working a quite a big project and I use `hook_entity_update()` in three of my modules. I do this to keep my project structured and have different functions of my site in different modules.
* Is it bad performance wise to have this hook called multiple times from different modules?
* Since this way of working makes... | 2021/12/17 | [
"https://drupal.stackexchange.com/questions/308777",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/41860/"
] | Of course you would have to benchmark your modules to get an exact answer, but generally speaking, the benefits of breaking up complex code into multiple modules separated by function is the way to go.
The performance impact of calling the hook is minimal; the larger performance impact will be whatever code the hook r... | The number of installed modules may influence performance. That's why, for example, Drupal core keeps in cache the name of the implemented hooks.
Given what Drupal core does, increasing the number of installed modules would have a lower impact on performance.
The aim for developers should not be reducing the number... |
36,017,469 | Imagine a sitution when caller creates a task:
```
{
var tWithCapturedCtx = Task.Run(...);
var tWithoutCapturedCtx = tWithCapturedCtx.ConfigureAwait(false);
await tWithoutCapturedCtx;
}
```
Is there a possibility that tWithCapturedCtx will execute so fast that the continuation will be executed on the captured co... | 2016/03/15 | [
"https://Stackoverflow.com/questions/36017469",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3284063/"
] | >
> Is there a possibility that tWithCapturedCtx will execute so fast that the continuation will be executed on the captured context?
>
>
>
Sort of.
If `tWithCapturedCtx` is already finished by the time the `await` is evaluated (which means `tWithoutCapturedCtx` is also already finished), then there is no continu... | `ConfigureAwait` is being called *before the continuation is even being added to the task*. The continuation is being added to the object that is configured to not capture the context, so it is not going to capture the context when its continuation is run (that's literally what it exists to do, it wouldn't be fulfillin... |
72,158,146 | I would like to check how can I re-write the query so I can show the different stages in different columns
original query:
```
select order_id, stage from table
```
original result:
```
order_id stage
111 1
111 1
222 1
111 2
111 3
111 4
222 2
```
the result i would like... | 2022/05/08 | [
"https://Stackoverflow.com/questions/72158146",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7318457/"
] | Redirections are processed left-to-right. That's certainly what Posix says: (Near the end of [the prologue to section 2.7](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07))
>
> If more than one redirection operator is specified with a command, the order of evaluation is from beginn... | ```
$ { echo hello;jiji jio; } 2> >(while read line;do echo "____$line";done) >right.log
____jiji: command not found
$ cat right.log
hello
```
In the above, it is like `jiji jio 2>&1 | while read line;do echo "____$line";done` and `echo hello >right.log`.
```
$ { echo hello;jiji jio; } >right.log 2> >(while read li... |
772,087 | Question: Let $ n,m \in \mathbb{Z}$. Prove the following:
$\forall$$(m \wedge n)$, if both $m$ and $n$ are even, then so is $mn.$
Attempt: By Definition 2.3.1, we let $ n \in \mathbb{Z}$. Then, $n$ is even whenever there exists some $ k \in \mathbb{Z}$ such that $ n = 2k$ and $n$ is odd whenever there exists some $ k... | 2014/04/27 | [
"https://math.stackexchange.com/questions/772087",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101829/"
] | It never hurts to provide more detail as long as it is pertinent to the proof.
I would have finished it off as follows:
$$mn = (2k)(2l) = 4(kl) =2(2kl)$$
and as $2kl\in \mathbb{Z}$, it is a witness to the conclusion that $mn$ is even. | Slightly clearer to use the associative property to rearrange the parentheses:
$$(2k)(2l) = (2)(k2l)$$
and $k2l$ is an integer because $k$, $2$, and $l$ are. |
772,087 | Question: Let $ n,m \in \mathbb{Z}$. Prove the following:
$\forall$$(m \wedge n)$, if both $m$ and $n$ are even, then so is $mn.$
Attempt: By Definition 2.3.1, we let $ n \in \mathbb{Z}$. Then, $n$ is even whenever there exists some $ k \in \mathbb{Z}$ such that $ n = 2k$ and $n$ is odd whenever there exists some $ k... | 2014/04/27 | [
"https://math.stackexchange.com/questions/772087",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101829/"
] | It never hurts to provide more detail as long as it is pertinent to the proof.
I would have finished it off as follows:
$$mn = (2k)(2l) = 4(kl) =2(2kl)$$
and as $2kl\in \mathbb{Z}$, it is a witness to the conclusion that $mn$ is even. | You basically have it. Using modular arithmetic to condense the argument, suppose $n \equiv 0 \pmod{2}$ and $m \equiv 0 \pmod{2}$. Then we have:
$$nm \equiv 0 \pmod{2}$$
by properties of modular arithmetic. In general, if $a \equiv b \pmod{n}$ and $x \equiv y \pmod{n}$, then $ax \equiv by \pmod{n}$. It's a good exerc... |
772,087 | Question: Let $ n,m \in \mathbb{Z}$. Prove the following:
$\forall$$(m \wedge n)$, if both $m$ and $n$ are even, then so is $mn.$
Attempt: By Definition 2.3.1, we let $ n \in \mathbb{Z}$. Then, $n$ is even whenever there exists some $ k \in \mathbb{Z}$ such that $ n = 2k$ and $n$ is odd whenever there exists some $ k... | 2014/04/27 | [
"https://math.stackexchange.com/questions/772087",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101829/"
] | You basically have it. Using modular arithmetic to condense the argument, suppose $n \equiv 0 \pmod{2}$ and $m \equiv 0 \pmod{2}$. Then we have:
$$nm \equiv 0 \pmod{2}$$
by properties of modular arithmetic. In general, if $a \equiv b \pmod{n}$ and $x \equiv y \pmod{n}$, then $ax \equiv by \pmod{n}$. It's a good exerc... | Slightly clearer to use the associative property to rearrange the parentheses:
$$(2k)(2l) = (2)(k2l)$$
and $k2l$ is an integer because $k$, $2$, and $l$ are. |
19,175,209 | I am trying to send sms programmatically using private API. My phone is not jailbroken.
```
BOOL success = [[CTMessageCenter sharedMessageCenter] sendSMSWithText:@"test 1234..." serviceCenter:nil toAddress:@"0777888888"];
if(success){
NSLog(@"Message SENT");
}else{
NSLog(@"Message not SENT");
}
```
This c... | 2013/10/04 | [
"https://Stackoverflow.com/questions/19175209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1716859/"
] | I guess, you have to write the telephone number in E.123 international notation.
So add plus sign and country code. For a phone number is USA replace the leading 0 with +1:
```
[[CTMessageCenter sharedMessageCenter] sendSMSWithText:@"test 1234..." serviceCenter:nil toAddress:@"+1777888888"];
```
For a phone number i... | I have been trying to do this on iOS 6.1 for way long and as I figured out eventually this method could not be used since iOS 6. Last time I could make this code execute successfully was on iOS 5 (there is a Peanut.app on the web working).
What actually worked is what can be found [here](https://stackoverflow.com/ques... |
42,171,960 | This is my first post. I am having a problem with the background color when I hover in a nav ul li a. It works well in mozilla but for some reason in chrome, only some of the menu items change on hover. Any help would be greatly appreciated.
```
<?php
$link = mysql_connect ("localhost", "pouredin_web", "Asdf... | 2017/02/11 | [
"https://Stackoverflow.com/questions/42171960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7548859/"
] | First tried to edit some of your code for formatting. Came accross this in your code:
```
...
<ul>
<li><a href="index.php"><span>HOME</span></a>
<li>
<li><a href="aboutus.php"><span>OUR COMPANY</span></a></li>
<li><a href="products.php"><span>PRODUCTS</span></a>
<ul>
<li><a href="ec... | Use this exactly:
```
<!DOCTYPE HTML>
<!--
Landed by HTML5 UP
html5up.net | @ajlkn
-->
<html>
<head>
<title>EPDM Polmers | EPDM Rubber Granules | Poured-In-Place Rubber</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--[if l... |
11,623,860 | I made this code:
```
protected Lala lala;
private Oyeha oyeha;
public void setLala(Lala lala) {
this.lala = lala;
}
this.oyeha = (Oyeha) this.lala;
executeHostBean = this.oyeha.updateMethod(a, b, c, d, e);
```
Lala is the parrent class.
Oyeha is the child which extends Lala.
But when i run this ... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11623860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084759/"
] | What you'll need is a ListView. A ListView is a view that orders its child views in a scrolling vertical list automatically depending on the elements present in the dataset observed by the Adapter given to it. Essentially, there are three parts:
1. The dataset that contains the data you want to display.
2. The Adapter... | Just inflate a custom view on Override of the getView method on the adapter being used by the ListView (instead of android\_simple\_listview\_item). On your case supply layout\_weight and weigh\_sum attributes on the XML layout resource to control the apperance of your view. Just use the Date and Calendar java classes ... |
11,623,860 | I made this code:
```
protected Lala lala;
private Oyeha oyeha;
public void setLala(Lala lala) {
this.lala = lala;
}
this.oyeha = (Oyeha) this.lala;
executeHostBean = this.oyeha.updateMethod(a, b, c, d, e);
```
Lala is the parrent class.
Oyeha is the child which extends Lala.
But when i run this ... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11623860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084759/"
] | What you'll need is a ListView. A ListView is a view that orders its child views in a scrolling vertical list automatically depending on the elements present in the dataset observed by the Adapter given to it. Essentially, there are three parts:
1. The dataset that contains the data you want to display.
2. The Adapter... | Write your own Custom Adapter. You will create your own layout, in which you can set any kind of an item which is created based on your own custom layout. Check out the following [link](http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/).It will definitely help you.
You can add your calc... |
11,623,860 | I made this code:
```
protected Lala lala;
private Oyeha oyeha;
public void setLala(Lala lala) {
this.lala = lala;
}
this.oyeha = (Oyeha) this.lala;
executeHostBean = this.oyeha.updateMethod(a, b, c, d, e);
```
Lala is the parrent class.
Oyeha is the child which extends Lala.
But when i run this ... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11623860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084759/"
] | Here are what you need:
1. A class contains those data: `Date1`, `Num1`, `Num2`, `CalculatedNum`
2. A custom adapter which extends from `BaseAdapter`
3. A layout for for an item within `ListView`
4. Main layout, which contain the `ListView`
5. Finally, the main activity which consists of two `TextView`, two `EditText`... | What you'll need is a ListView. A ListView is a view that orders its child views in a scrolling vertical list automatically depending on the elements present in the dataset observed by the Adapter given to it. Essentially, there are three parts:
1. The dataset that contains the data you want to display.
2. The Adapter... |
11,623,860 | I made this code:
```
protected Lala lala;
private Oyeha oyeha;
public void setLala(Lala lala) {
this.lala = lala;
}
this.oyeha = (Oyeha) this.lala;
executeHostBean = this.oyeha.updateMethod(a, b, c, d, e);
```
Lala is the parrent class.
Oyeha is the child which extends Lala.
But when i run this ... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11623860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084759/"
] | There are many ways to do this, some better than others in certain situations.
**Understand the classes you will be using**
As posted in another answer you will need:
* A `ListView` of some flavour to display your data
* An adapter of some sort (`BaseAdapter` will do fine) to handle displaying your data
* A variable... | Just inflate a custom view on Override of the getView method on the adapter being used by the ListView (instead of android\_simple\_listview\_item). On your case supply layout\_weight and weigh\_sum attributes on the XML layout resource to control the apperance of your view. Just use the Date and Calendar java classes ... |
11,623,860 | I made this code:
```
protected Lala lala;
private Oyeha oyeha;
public void setLala(Lala lala) {
this.lala = lala;
}
this.oyeha = (Oyeha) this.lala;
executeHostBean = this.oyeha.updateMethod(a, b, c, d, e);
```
Lala is the parrent class.
Oyeha is the child which extends Lala.
But when i run this ... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11623860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084759/"
] | Here are what you need:
1. A class contains those data: `Date1`, `Num1`, `Num2`, `CalculatedNum`
2. A custom adapter which extends from `BaseAdapter`
3. A layout for for an item within `ListView`
4. Main layout, which contain the `ListView`
5. Finally, the main activity which consists of two `TextView`, two `EditText`... | Just inflate a custom view on Override of the getView method on the adapter being used by the ListView (instead of android\_simple\_listview\_item). On your case supply layout\_weight and weigh\_sum attributes on the XML layout resource to control the apperance of your view. Just use the Date and Calendar java classes ... |
11,623,860 | I made this code:
```
protected Lala lala;
private Oyeha oyeha;
public void setLala(Lala lala) {
this.lala = lala;
}
this.oyeha = (Oyeha) this.lala;
executeHostBean = this.oyeha.updateMethod(a, b, c, d, e);
```
Lala is the parrent class.
Oyeha is the child which extends Lala.
But when i run this ... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11623860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084759/"
] | There are many ways to do this, some better than others in certain situations.
**Understand the classes you will be using**
As posted in another answer you will need:
* A `ListView` of some flavour to display your data
* An adapter of some sort (`BaseAdapter` will do fine) to handle displaying your data
* A variable... | Write your own Custom Adapter. You will create your own layout, in which you can set any kind of an item which is created based on your own custom layout. Check out the following [link](http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/).It will definitely help you.
You can add your calc... |
11,623,860 | I made this code:
```
protected Lala lala;
private Oyeha oyeha;
public void setLala(Lala lala) {
this.lala = lala;
}
this.oyeha = (Oyeha) this.lala;
executeHostBean = this.oyeha.updateMethod(a, b, c, d, e);
```
Lala is the parrent class.
Oyeha is the child which extends Lala.
But when i run this ... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11623860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084759/"
] | Here are what you need:
1. A class contains those data: `Date1`, `Num1`, `Num2`, `CalculatedNum`
2. A custom adapter which extends from `BaseAdapter`
3. A layout for for an item within `ListView`
4. Main layout, which contain the `ListView`
5. Finally, the main activity which consists of two `TextView`, two `EditText`... | Write your own Custom Adapter. You will create your own layout, in which you can set any kind of an item which is created based on your own custom layout. Check out the following [link](http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/).It will definitely help you.
You can add your calc... |
11,623,860 | I made this code:
```
protected Lala lala;
private Oyeha oyeha;
public void setLala(Lala lala) {
this.lala = lala;
}
this.oyeha = (Oyeha) this.lala;
executeHostBean = this.oyeha.updateMethod(a, b, c, d, e);
```
Lala is the parrent class.
Oyeha is the child which extends Lala.
But when i run this ... | 2012/07/24 | [
"https://Stackoverflow.com/questions/11623860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084759/"
] | Here are what you need:
1. A class contains those data: `Date1`, `Num1`, `Num2`, `CalculatedNum`
2. A custom adapter which extends from `BaseAdapter`
3. A layout for for an item within `ListView`
4. Main layout, which contain the `ListView`
5. Finally, the main activity which consists of two `TextView`, two `EditText`... | There are many ways to do this, some better than others in certain situations.
**Understand the classes you will be using**
As posted in another answer you will need:
* A `ListView` of some flavour to display your data
* An adapter of some sort (`BaseAdapter` will do fine) to handle displaying your data
* A variable... |
62,698,897 | I am a Laravel/web newbie, and am working with a Laravel application inherited from someone else. In the blades, I see two ways in which forms are written.
1. `<form action="{{ route('getdata') }}"`
2. `{!! Form::open(array('url'=>'getdata','`
I think in the first case, the form starts in HTML format and route alon... | 2020/07/02 | [
"https://Stackoverflow.com/questions/62698897",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2194126/"
] | Easily done with Associative arrays
```
declare -A array
for file in *.txt; { array[${file%-*}]=''; }
echo ${!array[@]}
```
Update. If `declare -A array` removed then we've got simple indexed array witch in this case is also works, because we need to store only numbers, but we store them as indexes not as data. | you can make use of associative arrays
```
declare -A chk
declare -a uniques
while read -r line; do
#do something with line or use multiple variables instead of line
v="$(cut -d " " -f 1 <<< $line)"
[[ ${chk[$v]} ]] || uniques+=("$v")
chk[$v]=1
done < file.txt
``` |
46,157,299 | I have a base class `Fallible<T>` and several derived classes `Success<T>`, `Failure<T>` and `BadIdea<T>` which are to be used in the return value of a WCF service call.
As I [previously discovered](https://stackoverflow.com/questions/41965504/serializationexception-when-returning-custom-classes-from-a-wcf-service), i... | 2017/09/11 | [
"https://Stackoverflow.com/questions/46157299",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706346/"
] | So I tried to replicate your issue with a trimmed down version of your code and ended up with this
```
[ServiceContract]
public interface IService1
{
//Get a patient's data
[OperationContract]
[ServiceKnownType(typeof(Fallible<Patient>))]
[ServiceKnownType(typeof(Success<Patient>))]
Fallible<Patie... | ```
[ServiceContract]
[ServiceKnownType("GetKnownTypes", typeof(CommandServiceHelper))]
public interface IPatientService
{
//Your interface methdos
}
```
this is the helper class that will be called each time that WCF need to know a type.
```
public static class CommandServiceHelper
{
public static IEnumera... |
20,849,969 | For the following equation:

Do we write it in `MATLAB` as follows:
```
sum=0;
for j=1:k
for i=1:n
sum = sum + (u(i,j)*log2(u(i,j)+(1-u(i,j)*log2(1-u(i,j)))))/n;
end
end
result = -1 * sum;
```
Thanks. | 2013/12/31 | [
"https://Stackoverflow.com/questions/20849969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/588855/"
] | **to quote Jongware:** *no, that's not how we do it!*
you rather write:
```
fun = @(x) x*log2(x)+(1-x)*log2(1-x);
result = -1/n*sum( arrayfun(fun,u(:)) )
``` | ```
sum=0;
for i=1:k
for j=1:n
sum = sum + (u(i,j)*log2(u(i,j)+(1-u(i,j)*log2(1-u(i,j)))))/n;
end
end
result = -1 * sum;
``` |
20,849,969 | For the following equation:

Do we write it in `MATLAB` as follows:
```
sum=0;
for j=1:k
for i=1:n
sum = sum + (u(i,j)*log2(u(i,j)+(1-u(i,j)*log2(1-u(i,j)))))/n;
end
end
result = -1 * sum;
```
Thanks. | 2013/12/31 | [
"https://Stackoverflow.com/questions/20849969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/588855/"
] | **to quote Jongware:** *no, that's not how we do it!*
you rather write:
```
fun = @(x) x*log2(x)+(1-x)*log2(1-x);
result = -1/n*sum( arrayfun(fun,u(:)) )
``` | Here's how I would write that:
1. In Matlab we tend to avoid loops.
2. Considering the form of your equation, the two sums can be collapsed into one. In Matlab we can do that by using [linear indexing](http://www.mathworks.es/company/newsletters/articles/matrix-indexing-in-matlab.html).
3. Move the `n` out of the sum ... |
20,849,969 | For the following equation:

Do we write it in `MATLAB` as follows:
```
sum=0;
for j=1:k
for i=1:n
sum = sum + (u(i,j)*log2(u(i,j)+(1-u(i,j)*log2(1-u(i,j)))))/n;
end
end
result = -1 * sum;
```
Thanks. | 2013/12/31 | [
"https://Stackoverflow.com/questions/20849969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/588855/"
] | Here's how I would write that:
1. In Matlab we tend to avoid loops.
2. Considering the form of your equation, the two sums can be collapsed into one. In Matlab we can do that by using [linear indexing](http://www.mathworks.es/company/newsletters/articles/matrix-indexing-in-matlab.html).
3. Move the `n` out of the sum ... | ```
sum=0;
for i=1:k
for j=1:n
sum = sum + (u(i,j)*log2(u(i,j)+(1-u(i,j)*log2(1-u(i,j)))))/n;
end
end
result = -1 * sum;
``` |
43,638,337 | I'm trying to create a one-to-many relationship between Publications and Authors, however for some reason when I persist the Publication, the Authors get persisted, but the Join table is empty.
**Publication.java**
```
@Id
@Column(name="PUBLICATIONID")
private String id;
@OneToMany(cascade = CascadeType.ALL, mappedB... | 2017/04/26 | [
"https://Stackoverflow.com/questions/43638337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/981130/"
] | You are using `@JoinColumn` which indicates you are using a FK column in the authors table to link publications to their authors.
If you want to use a join table you need to remove this and use the `@JoinTable` annotation. However it seems to me that you have your mappings the wrong way round. Surely the relationship ... | You haven't defined it to use a `@JoinTable`; it is currently using a foreign key hence why no insert into the join table. You need to add
```
@JoinTable
```
to the one to many field (*authors*). Don't forget to remove the `@JoinColumn` since that is for FK relations |
72,333,773 | Does Python sort arrays with multiple keys with or without executing the second key? (It does execute the second key) If so is there a way to stop it from evaluating the second key when it is unnecessary? Is there a module that would be able to do this easily without having to add extra code?
```
import random
import ... | 2022/05/21 | [
"https://Stackoverflow.com/questions/72333773",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5075065/"
] | ### Solution 1: Separate sorts
You could sort and group by `cheap`, then sort each group of more than one element by `expensive`:
```
alist.sort(key=cheap)
result = []
for _, [*g] in itertools.groupby(alist, cheap):
if len(g) > 1:
g.sort(key=expensive)
result += g
print(result)
```
### Solution 2: D... | It does run the second function, one way around this is to sort it by the first key, and then the second
```
values = set(map(lambda x:x[1], alist))
newlist = [[y[0] for y in alist if y[1]==x] for x in values]
```
uhh, IDK past this point. I really just wanted to open a discussion, |
72,333,773 | Does Python sort arrays with multiple keys with or without executing the second key? (It does execute the second key) If so is there a way to stop it from evaluating the second key when it is unnecessary? Is there a module that would be able to do this easily without having to add extra code?
```
import random
import ... | 2022/05/21 | [
"https://Stackoverflow.com/questions/72333773",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5075065/"
] | As you've noticed, putting the `expensive` call in the `lambda` function you pass as the `key` function for your sort eagerly calls the expensive calculation for every value. If that's undesirable, you might need to write your own object to be returned by the key function, which lazily computes values if they're needed... | It does run the second function, one way around this is to sort it by the first key, and then the second
```
values = set(map(lambda x:x[1], alist))
newlist = [[y[0] for y in alist if y[1]==x] for x in values]
```
uhh, IDK past this point. I really just wanted to open a discussion, |
72,333,773 | Does Python sort arrays with multiple keys with or without executing the second key? (It does execute the second key) If so is there a way to stop it from evaluating the second key when it is unnecessary? Is there a module that would be able to do this easily without having to add extra code?
```
import random
import ... | 2022/05/21 | [
"https://Stackoverflow.com/questions/72333773",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5075065/"
] | ### Solution 1: Separate sorts
You could sort and group by `cheap`, then sort each group of more than one element by `expensive`:
```
alist.sort(key=cheap)
result = []
for _, [*g] in itertools.groupby(alist, cheap):
if len(g) > 1:
g.sort(key=expensive)
result += g
print(result)
```
### Solution 2: D... | You can inherit `int` and implement a new comparison method:
```
class Comparer(int):
def __lt__(self, other):
if not isinstance(other, Comparer):
return NotImplemented
diff = cheap(self) - cheap(other)
if diff < 0:
return True
elif diff > 0:
ret... |
72,333,773 | Does Python sort arrays with multiple keys with or without executing the second key? (It does execute the second key) If so is there a way to stop it from evaluating the second key when it is unnecessary? Is there a module that would be able to do this easily without having to add extra code?
```
import random
import ... | 2022/05/21 | [
"https://Stackoverflow.com/questions/72333773",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5075065/"
] | As you've noticed, putting the `expensive` call in the `lambda` function you pass as the `key` function for your sort eagerly calls the expensive calculation for every value. If that's undesirable, you might need to write your own object to be returned by the key function, which lazily computes values if they're needed... | You can inherit `int` and implement a new comparison method:
```
class Comparer(int):
def __lt__(self, other):
if not isinstance(other, Comparer):
return NotImplemented
diff = cheap(self) - cheap(other)
if diff < 0:
return True
elif diff > 0:
ret... |
64,686,261 | I'm trying to fetch a checkin.cfm file from within my index.cfm using the fetch api. All I'm getting is a 500 Server Error. Is there something different I need to do with ColdFusion?
**JavaScript**
```
fetch("./src/checkin.cfm")
.then(function (response) {
return response.text();
})
.then(function... | 2020/11/04 | [
"https://Stackoverflow.com/questions/64686261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2464865/"
] | You need to Serialise your data in the ‘CFML’ template:
**checkin.cfm**
OPTION 1:
```
<cfset data = StructNew()>
<cfset data['session_valid'] = application.lib.check_session_valid()>
<cfset data['html'] = '<h1>Hello World</h1>'>
<cfoutput>
#SerializeJSON(data)#
</cfoutput>
```
OPTION 2:
```
<cfset data = Stru... | According to [this SO question](https://stackoverflow.com/a/36632271/11047), you're using `fetch` correctly with `response.text()` to render the HTML from the request.
Check your browser's dev tools:
* Network tab
* filter to `checkin.cfm`, should have a `500` status
* click that line and preview the response.
Follo... |
2,411,324 | I'm building an API for my app and would like to return errors in the XML response that are generated by validation errors.
So say you're registering on the site, right now the validation errors returned might be:
```
Login has already been taken
Password is too short (minimum is 6 characters)
Email has already been ... | 2010/03/09 | [
"https://Stackoverflow.com/questions/2411324",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/147586/"
] | Rails gives you this functionality by default, i.e.
```
user.errors.to_xml
```
Will give you
```
=> <?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Name can't be blank</error>
<error>Wiki url can't be blank</error>
<error>User can't be blank</error>
</errors>
```
Rails 7
```
us... | The model object will have an [errors](http://api.rubyonrails.org/classes/ActiveRecord/Errors.html) object that you can iterate, some examples in the [validations](http://api.rubyonrails.org/classes/ActiveRecord/Validations.html) doc. |
2,411,324 | I'm building an API for my app and would like to return errors in the XML response that are generated by validation errors.
So say you're registering on the site, right now the validation errors returned might be:
```
Login has already been taken
Password is too short (minimum is 6 characters)
Email has already been ... | 2010/03/09 | [
"https://Stackoverflow.com/questions/2411324",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/147586/"
] | Rails gives you this functionality by default, i.e.
```
user.errors.to_xml
```
Will give you
```
=> <?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Name can't be blank</error>
<error>Wiki url can't be blank</error>
<error>User can't be blank</error>
</errors>
```
Rails 7
```
us... | Call #to\_xml on errors method
```
user = User.new
unless user.valid?
return user.errors.to_xml
end
``` |
31,492,181 | I'd like to remove an `id` from an image after its animation is completed. I have this in my code:
```
if(index == 1 && direction =='down'){
$('#slidetext1 #rock').animate({right:"0"});
$('#slidetext1 #deer').animate({left: "0"}).addClass('open').removeAttr('id');
}
```
It's not working because it removes th... | 2015/07/18 | [
"https://Stackoverflow.com/questions/31492181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4381444/"
] | The URL you use in your example seems to be incomplete: it should read ...`interpreter?data=[out:json]`.... i.e. the **data=** part was missing.
As a reference you can also put your query in overpass turbo and simply click on Export -> raw data directly from Overpass API to get to a working URL. Maybe try this first w... | Without a library, we have to `POST` a query formatted in [OverpassQL](https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL).
This example will retrieve restaurants into a rather small bounding box *bottom\_left/top\_right* `48.865,2.25,48.9,2.27` somewhere in Paris.
```js
(async () => {
const api = await f... |
45,142,369 | I am using [slick](http://kenwheeler.github.io/slick/) to make slider. However on implementation. I realised I need to make different classes for the different blocks. The properties remain unchanged apart from the classes that differ. Can I get help on refactoring the code below. A loop that doesn't need ES6 but just ... | 2017/07/17 | [
"https://Stackoverflow.com/questions/45142369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6773883/"
] | You don't need a loop. As all the initialisation parameters are the same you can just select the three elements and call `slick()` on them at the same time:
```
jQuery(function($){
$('.mps-carousel, .uganda-carousel, .kenya-carousel').slick({
// your options...
});
});
```
Also note the use of the modified d... | As an alternative, give any element you want to use `slick()` on a new class, like `.slick-carousel`. And then use:
```js
jQuery(function($){
$('.slick-carousel').each(function() {
$(this).slick({
// ...options
});
});
});
```
```html
<div class="mps-carousel slick-carousel"></div>
<div cla... |
25,600,695 | i have one table contain 2 fields named as date,val
datas are
```
date val
2014-08-01 A
2014-08-02 B
2014-08-03 A
2014-08-04 A
2014-08-05 B
2014-08-06 B
2014-08-07 A
2014-08-08 A
2014-08-09 B
2014-08-10 A
2014-08-11 A
```
i want a table the output like this
```
MIN MAX A B... | 2014/09/01 | [
"https://Stackoverflow.com/questions/25600695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3996048/"
] | i think this will help you :
```
DECLARE @MinDate DATETIME
DECLARE @MaxDate DATETIME
DECLARE @StartDate DATETIME
DECLARE @DayCount INT
DECLARE @A_Count INT
DECLARE @B_Count INT
SET @DayCount = 5
SELECT TOP 1 @MinDate=[date] FROM table_1 ORDER BY date
SELECT TOP 1 @MaxDate=[date] FROM table_1 ORDER BY date DESC
... | You can execute a query like this:
```
SELECT MAX(date), MIN(date), val, COUNT(val) AS occurence
FROM table
WHERE date>minDate AND date<maxDate
GROUP BY val
```
where **minDate** and **maxDate** are your varables.
Result will be read in this way: Value "val" apper "occurence" time between minDate and maxDate |
25,600,695 | i have one table contain 2 fields named as date,val
datas are
```
date val
2014-08-01 A
2014-08-02 B
2014-08-03 A
2014-08-04 A
2014-08-05 B
2014-08-06 B
2014-08-07 A
2014-08-08 A
2014-08-09 B
2014-08-10 A
2014-08-11 A
```
i want a table the output like this
```
MIN MAX A B... | 2014/09/01 | [
"https://Stackoverflow.com/questions/25600695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3996048/"
] | i think this will help you :
```
DECLARE @MinDate DATETIME
DECLARE @MaxDate DATETIME
DECLARE @StartDate DATETIME
DECLARE @DayCount INT
DECLARE @A_Count INT
DECLARE @B_Count INT
SET @DayCount = 5
SELECT TOP 1 @MinDate=[date] FROM table_1 ORDER BY date
SELECT TOP 1 @MaxDate=[date] FROM table_1 ORDER BY date DESC
... | ```
DROP TABLE IF EXISTS my_table;
CREATE TABLE my_table
(date DATE NOT NULL
,val CHAR(1) NOT NULL
,PRIMARY KEY (date)
);
INSERT INTO my_table VALUES
('2014-08-01','A'),
('2014-08-02','B'),
('2014-08-03','A'),
('2014-08-04','A'),
('2014-08-05','B'),
('2014-08-06','B'),
('2014-08-07','A'),
('2014-08-08','A'),
(... |
11,123,211 | I'm definitive new on Dynamic CRM 2011, so maybe this question is really easy.
I'm connecting throw a WCF Service to **different** instances of CRM whit this part of code:
```
var settings = new ConnectionStringSettings("Xrm", connectionString);
var connection = new CrmConnection(settings);
using (var xrm = ne... | 2012/06/20 | [
"https://Stackoverflow.com/questions/11123211",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/941000/"
] | Ok, I found a solution, I don't know if is the best solution, but it works...
Instead of using this
```
var settings = new ConnectionStringSettings("Xrm", connectionString);
var connection = new CrmConnection(settings);
```
I use
```
var connection = CrmConnection.Parse(connectionString);
```
That's giving me... | The underlying issue here is that some properties are cached for each `ConnectionStringSettings`. You can avoid this by giving using a unique name for each instance (eg: Xrm1, Xrm2 etc). I'm not sure thus behaviour is explicitly documented in the SDK but I've certainly encountered it and fixed it as I indicated. |
53,093,379 | Not able to login Ubuntu from GUI but console is fine. Then I tried
```
systemctl start lightdm
```
It shows
```
Unit lightdm.service not found.
```
After reinstalling lightdm, got same result: lightdm.service not found
Ubuntu I'm using should be the newest version which I downloaded yesterday.(Oct30/2018)
Not ... | 2018/10/31 | [
"https://Stackoverflow.com/questions/53093379",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9477159/"
] | if i were you i would try to achieve the same effect with only css using rotation for the container, inverting the text rotation with the same amount, then using a pseudo element (:after) with absolute positioning to achieve the non rectangular shape effect.
run the snippet for an example that you can adjust to fit yo... | Since the first and second version you gave differ so much, I am not that sure what it is you want to achieve. I'm going mostly with the first one.
The main trick is with the way you use the [`viewBox`](https://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute) attribute (and its accompaining [`preserveAspectRatio`](ht... |
11,096,181 | I've a program producing one big xml every day and I want to save space, and there are some information that are not usefull after some time. I want to remove this information, for example my xml is now:
```
<owner name="thename">
<datasets ndatasets="10" size="10000">
<dataset size="100" creationdate="...">... | 2012/06/19 | [
"https://Stackoverflow.com/questions/11096181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/238671/"
] | **An XSLT solution** (Sean's solution is good, but it would stop working if elements or nodes other that `dataset` were made children of `datasets`):
```
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*... | Here is an XSLT 1.0 style-sheet:
```
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="dataset" />
</xsl:sty... |
11,096,181 | I've a program producing one big xml every day and I want to save space, and there are some information that are not usefull after some time. I want to remove this information, for example my xml is now:
```
<owner name="thename">
<datasets ndatasets="10" size="10000">
<dataset size="100" creationdate="...">... | 2012/06/19 | [
"https://Stackoverflow.com/questions/11096181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/238671/"
] | **An XSLT solution** (Sean's solution is good, but it would stop working if elements or nodes other that `dataset` were made children of `datasets`):
```
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*... | I think @Sean B. Durkin answer is simpler but if you want to do it the hard way with `lxml`:
```
from lxml import etree
from StringIO import StringIO
xml = etree.parse(StringIO('''<owner name="thename">
<datasets ndatasets="10" size="10000">
<dataset size="100" creationdate="...">mydataset1</dataset>
... |
21,221,876 | I would like to split up text by comma - i.e. keywords are as the following:
```
keyword1, keyword2, keyword3, keyword4
```
How can I have a the black style element for each and every keyword that is separated by a comma. Is there an easy way to do this? The text is always dynamic, so I never know exactly what those... | 2014/01/19 | [
"https://Stackoverflow.com/questions/21221876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/673600/"
] | CSS is unable to select text.
In order to highlight the keywords on a page, you need to use programming languages such as JavaScript *(for client-side)* or PHP *(or whatever else for server-side)* to wrap the keywords by a wrapper element which has a special CSS style to distinguish the keys.
Here, I implemented the ... | HTML and CSS are static. Since you don't know how many keywords are gonna be there, you need something dynamic. Depending on implementation, you can use JavaScript or any Back-end language you are using.
Basically, you want to add a span tag around each keyword and style that span (span in one with class keyword-opt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.