qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
11,571,327 | I have been unable to figure this out, I think the problem might be in the way I am making the list of lists. Can anyone help out? Thanks!
My desired outcome is
codondict = {'A': ['GCT','GCC','GCA','GCG'], 'C': ['TGT','TGC'], &c
but what i get is:
{'A': 'A', 'C': 'C', &c.
Here's my terminal:
>
>
> >
> >
> > >... | 2012/07/20 | [
"https://Stackoverflow.com/questions/11571327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1539097/"
] | You can try this:
```
condondict= dict(A=['GCT','GCC','GCA','GCG'],
C=['TGT','TGC'],
D=['GAT','GAC'],
E=['GAA','GAG'],
F=['TTT','TTC'],
G=['GGT','GGC','GGA','GGG'],
H=['CAT','CAC'],
I=['ATT','ATC','ATA'],
K=['AAA','AAG'],
L=['TTA','TTG','CTT','CTC','CTA','CTG'],
M=['ATG'],
N=['AAT','AAC'],
P=['CCT','CCC','CCA','CCG'],... | That's kind of verbose, and is confusing the name of a variable `'A'` with its value `A`. Keeping to what you've got:
```
aminoacids = { 'A': A, 'C': C, 'D': D ... }
```
should get you the dictionary you ask for:
```
{ 'A' : ['GCT', 'GCC', 'GCA', 'GCG'], 'C' : ['TGT', 'TGC'], ... }
```
where the order of keys `'A... |
11,571,327 | I have been unable to figure this out, I think the problem might be in the way I am making the list of lists. Can anyone help out? Thanks!
My desired outcome is
codondict = {'A': ['GCT','GCC','GCA','GCG'], 'C': ['TGT','TGC'], &c
but what i get is:
{'A': 'A', 'C': 'C', &c.
Here's my terminal:
>
>
> >
> >
> > >... | 2012/07/20 | [
"https://Stackoverflow.com/questions/11571327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1539097/"
] | Another way to do what you need is using the [`locals()`](http://docs.python.org/library/functions.html#locals) function, which returns a dictionary containing the whole set of variables of the local scope, with the variable names as the keys and its contents as values.
```
for i in aminoacids:
codondict[i] = loca... | That's kind of verbose, and is confusing the name of a variable `'A'` with its value `A`. Keeping to what you've got:
```
aminoacids = { 'A': A, 'C': C, 'D': D ... }
```
should get you the dictionary you ask for:
```
{ 'A' : ['GCT', 'GCC', 'GCA', 'GCG'], 'C' : ['TGT', 'TGC'], ... }
```
where the order of keys `'A... |
11,571,327 | I have been unable to figure this out, I think the problem might be in the way I am making the list of lists. Can anyone help out? Thanks!
My desired outcome is
codondict = {'A': ['GCT','GCC','GCA','GCG'], 'C': ['TGT','TGC'], &c
but what i get is:
{'A': 'A', 'C': 'C', &c.
Here's my terminal:
>
>
> >
> >
> > >... | 2012/07/20 | [
"https://Stackoverflow.com/questions/11571327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1539097/"
] | You can try this:
```
condondict= dict(A=['GCT','GCC','GCA','GCG'],
C=['TGT','TGC'],
D=['GAT','GAC'],
E=['GAA','GAG'],
F=['TTT','TTC'],
G=['GGT','GGC','GGA','GGG'],
H=['CAT','CAC'],
I=['ATT','ATC','ATA'],
K=['AAA','AAG'],
L=['TTA','TTG','CTT','CTC','CTA','CTG'],
M=['ATG'],
N=['AAT','AAC'],
P=['CCT','CCC','CCA','CCG'],... | Another way to do what you need is using the [`locals()`](http://docs.python.org/library/functions.html#locals) function, which returns a dictionary containing the whole set of variables of the local scope, with the variable names as the keys and its contents as values.
```
for i in aminoacids:
codondict[i] = loca... |
11,571,327 | I have been unable to figure this out, I think the problem might be in the way I am making the list of lists. Can anyone help out? Thanks!
My desired outcome is
codondict = {'A': ['GCT','GCC','GCA','GCG'], 'C': ['TGT','TGC'], &c
but what i get is:
{'A': 'A', 'C': 'C', &c.
Here's my terminal:
>
>
> >
> >
> > >... | 2012/07/20 | [
"https://Stackoverflow.com/questions/11571327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1539097/"
] | You can try this:
```
condondict= dict(A=['GCT','GCC','GCA','GCG'],
C=['TGT','TGC'],
D=['GAT','GAC'],
E=['GAA','GAG'],
F=['TTT','TTC'],
G=['GGT','GGC','GGA','GGG'],
H=['CAT','CAC'],
I=['ATT','ATC','ATA'],
K=['AAA','AAG'],
L=['TTA','TTG','CTT','CTC','CTA','CTG'],
M=['ATG'],
N=['AAT','AAC'],
P=['CCT','CCC','CCA','CCG'],... | You can use globals() built-in too, and dict comprehension:
```
codondict = {k:globals()[k] for k in aminoacids}
```
it's better to rely on locals() instead of globals(), like stummjr's solution, but you can't do so with dict comprehension directly
```
codondict = dict([(k,locals()[k]) for k in aminoacids])
```
H... |
11,571,327 | I have been unable to figure this out, I think the problem might be in the way I am making the list of lists. Can anyone help out? Thanks!
My desired outcome is
codondict = {'A': ['GCT','GCC','GCA','GCG'], 'C': ['TGT','TGC'], &c
but what i get is:
{'A': 'A', 'C': 'C', &c.
Here's my terminal:
>
>
> >
> >
> > >... | 2012/07/20 | [
"https://Stackoverflow.com/questions/11571327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1539097/"
] | Another way to do what you need is using the [`locals()`](http://docs.python.org/library/functions.html#locals) function, which returns a dictionary containing the whole set of variables of the local scope, with the variable names as the keys and its contents as values.
```
for i in aminoacids:
codondict[i] = loca... | You can use globals() built-in too, and dict comprehension:
```
codondict = {k:globals()[k] for k in aminoacids}
```
it's better to rely on locals() instead of globals(), like stummjr's solution, but you can't do so with dict comprehension directly
```
codondict = dict([(k,locals()[k]) for k in aminoacids])
```
H... |
36,801,886 | I'm trying to use a fast enough solution (*and avoid loops*) for the following problem:
I have a matrix nxn (square but not necessarily) and a vector or size nx1. I want to divide every row of the matrix by the reciprocal element in the vector as follows:
* First row should be divided by the 1st vector element,
* Seco... | 2016/04/22 | [
"https://Stackoverflow.com/questions/36801886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084219/"
] | This is what the `sweep` function is for
```
mm <- matrix(rep(1:5, 7), ncol=7)
d <- 1:5
sweep(mm, 1, d, "/")
```
Here we tell sweep that for every row of `mm` (for MARGIN 1=rows, 2=columns) divide out the corresponding value from `d` | Could you just divide the matrix by the vector?
```
m <- matrix(1:20, nrow=5)
#[,1] [,2] [,3] [,4]
#[1,] 1 6 11 16
#[2,] 2 7 12 17
#[3,] 3 8 13 18
#[4,] 4 9 14 19
#[5,] 5 10 15 20
v <- 5:1
#[1] 5 4 3 2 1
#Divide matrix row 1 by 5 (v[1])
#Divide matrix row 2 by 4 (v[2... |
317,890 | Is it "finger clicking"?
What verb should I use if not "click"? "Snap"? Are both ok? It's just that if I say "finger snapping", one may imagine something violent.
[](https://i.stack.imgur.com/4ypaq.jpg) | 2022/06/26 | [
"https://ell.stackexchange.com/questions/317890",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/101901/"
] | *to snap one's fingers* is the common phrase. It has nothing to do with digital mayhem; rather it means to produce a snap sound with the fingers, as if by breaking a twig.
I think the actual sound is produced by one of the fingers slapping against the meaty part of the palm under the thumb after the finger is held u... | Yes "snap your fingers" is the common phrase, but "clicking" is also an alternative. The image you searched was even labelled as "finger snapping"!
>
> **Snapping (or clicking) one's fingers** is the act of creating a snapping or clicking sound with one's fingers. Primarily this is done by building tension between th... |
23,757,804 | I want to use PHP to request a datetime variable from html,
and use the variable to SELECT data from mysql database.Then make a json to generate highchart.
It successfully generate the json but didnt generate the highchart.
And I use Firebug it says TypeError: obj is null
Here is my code
PHP
```
<?php
header... | 2014/05/20 | [
"https://Stackoverflow.com/questions/23757804",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3656127/"
] | Your desired results appear a little inconsistent. Why is the desired result for 15 Orange but that for 63 Indigo?
Are you in fact attempting to match based on whichever corresponding value is *absolutely* closest to the search value, whether below or above that value?
If so:
=INDEX(B4:B10,MATCH(TRUE,INDEX(ABS(A4:A1... | Another method of doing this is to place the numbers and colours into a table, order numbers by highest to smallest and use the formula below:
```
=INDEX(B4:B10,MATCH(B1,A4:A10,-1))
``` |
48,026,971 | How do I implement a delete notification in swift? So if I have a delete button the "are you sure" notification box pops up with delete and cancel options, I thought it would be in the info.plist but haven't seen anything, can anyone help? | 2017/12/29 | [
"https://Stackoverflow.com/questions/48026971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9134986/"
] | You can create a subscription in your service that notifies if event list changed
```
eventChanged = new Subject<Event[]>();
```
in your component, you'll want to subscribe to the eventChanged, in case event list has changed
```
this.subscription = this.eventService.eventChanged
.subscribe(
(event: Event[]) =... | For example:
```
export class YourService {
private refreshSource: Subject<boolean> = new Subject();
public refreshStream: Observable<boolean> = this.refreshSource.asObservable();
endpoint_url = "https://<your_backend>/api/";
constructor(private client: HttpClient) {}
// get collection
cget(... |
41,692 | I want a nice pop in my explosion sounds, especially distant. I want to feel the "P" and I want to hear/feel massive release of energy/air. But most videos of explosion sounds that I have watched have a loud annoying hollow "BOOOM". I don't feel the B... It doesn't sound like something compressed bursting and releasing... | 2017/07/17 | [
"https://sound.stackexchange.com/questions/41692",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/21541/"
] | [Essentia](http://essentia.upf.edu/documentation/index.html) is an
>
> Open-source library and tools for audio and music analysis,
> description and synthesis
>
>
>
It includes some pre-built [extractors](http://essentia.upf.edu/documentation/extractors_out_of_box.html#extractors) that you can use. | Maybe you could use an eq that has a "matching" option (like izotope ozone eq) to compare the frequency content directly but I dont think there's anything more you can compare. |
41,692 | I want a nice pop in my explosion sounds, especially distant. I want to feel the "P" and I want to hear/feel massive release of energy/air. But most videos of explosion sounds that I have watched have a loud annoying hollow "BOOOM". I don't feel the B... It doesn't sound like something compressed bursting and releasing... | 2017/07/17 | [
"https://sound.stackexchange.com/questions/41692",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/21541/"
] | [Essentia](http://essentia.upf.edu/documentation/index.html) is an
>
> Open-source library and tools for audio and music analysis,
> description and synthesis
>
>
>
It includes some pre-built [extractors](http://essentia.upf.edu/documentation/extractors_out_of_box.html#extractors) that you can use. | You might want to take a look at the Voxengo Span Plus plugin. It at least allows you to display the spectrum from different channels/tracks simultaneously (at varying frequency resolution), but I think it may also let you compare different spectrums, <http://www.voxengo.com/product/spanplus/features/> |
41,692 | I want a nice pop in my explosion sounds, especially distant. I want to feel the "P" and I want to hear/feel massive release of energy/air. But most videos of explosion sounds that I have watched have a loud annoying hollow "BOOOM". I don't feel the B... It doesn't sound like something compressed bursting and releasing... | 2017/07/17 | [
"https://sound.stackexchange.com/questions/41692",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/21541/"
] | [Essentia](http://essentia.upf.edu/documentation/index.html) is an
>
> Open-source library and tools for audio and music analysis,
> description and synthesis
>
>
>
It includes some pre-built [extractors](http://essentia.upf.edu/documentation/extractors_out_of_box.html#extractors) that you can use. | I highly recommend studying the spectrum of these sounds. You can identify all the frequencies in a portion of sound, and how they change over time and their amplitudes. This is evident with a 2D or 3D spectrogram. The frequencies involved are essentially defining the timbre of the sounds.
You can download [iZotope RX... |
41,692 | I want a nice pop in my explosion sounds, especially distant. I want to feel the "P" and I want to hear/feel massive release of energy/air. But most videos of explosion sounds that I have watched have a loud annoying hollow "BOOOM". I don't feel the B... It doesn't sound like something compressed bursting and releasing... | 2017/07/17 | [
"https://sound.stackexchange.com/questions/41692",
"https://sound.stackexchange.com",
"https://sound.stackexchange.com/users/21541/"
] | [Essentia](http://essentia.upf.edu/documentation/index.html) is an
>
> Open-source library and tools for audio and music analysis,
> description and synthesis
>
>
>
It includes some pre-built [extractors](http://essentia.upf.edu/documentation/extractors_out_of_box.html#extractors) that you can use. | The freeware Sound-Similar Free is the right tool.
Sound-Similar (Free Version) is a lightweight software application that measures the perceptual similarity between two WAV files in Linear PCM format, the most commonly used format in WAV files. The degree of similarity is represented by a similarity score in percent... |
13,529,634 | I am using rails\_admin together with globalize3 and cannot get searchable associations to work. Here are the models (Person has\_one/belongs\_to Name has\_many/belongs\_to NameTranslation):
```
class Person < ActiveRecord::Base
has_one :name, inverse_of: :person
end
class Name < ActiveRecord::Base
belongs_to :pe... | 2012/11/23 | [
"https://Stackoverflow.com/questions/13529634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/92049/"
] | From [this thread](https://groups.google.com/forum/#!topic/rails_admin/z3578Boilx4), I followed Nick Roosevelt's suggestion and it worked for my case
```
class Room < ActiveRecord:Base
has_many :time_slots
end
class TimeSlot < ActiveRecord::Base
belongs_to :room
rails_admin do
list do
field :day do
... | I had a similar problem with a `has one` relationship.
The way I solved it was to set a `default_scope` on the model and join it with the associated table (it is was the only way I could get rails admin to join these two tables).
I also had to set `queryable true` on the associated field.
Imagine that you had to sear... |
33,505,105 | I am creating a query to return some data from a database.
I am passing in a list of ids that I want to filter on. If the filter list is null or empty I want to return all the things.
I have an extension method that lets me do this
`query` is an `IQueryable`, `Ids` is a list of nullable ints (don't ask!) `ListHasEleme... | 2015/11/03 | [
"https://Stackoverflow.com/questions/33505105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5552/"
] | Quote from [MSDN](https://msdn.microsoft.com/en-us/library/bb397947.aspx):
>
> Some queries must be expressed as method calls
>
>
>
This is one of those cases. Even some of their own extension methods must be called via method syntax. For example, `Count`. | YES!
```
var query = from a in dbContext.as.WhereIf(ListHasElements(Ids), s => Ids.Contains(s.Id.Value))
join b in dbContext.bs on a.Id.ToString() equals b.Id
join cin dbContext.cs on b.Id equals c.Id into bcJoin
from items in bcJoin.DefaultIfEmpty()
where b.Sent >= fromDate
whe... |
33,505,105 | I am creating a query to return some data from a database.
I am passing in a list of ids that I want to filter on. If the filter list is null or empty I want to return all the things.
I have an extension method that lets me do this
`query` is an `IQueryable`, `Ids` is a list of nullable ints (don't ask!) `ListHasEleme... | 2015/11/03 | [
"https://Stackoverflow.com/questions/33505105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5552/"
] | You can't. The compiler takes well-known query syntax keywords and converts them to method syntax behind-the-scenes. It knows nothing of your custom extension and thus has no equivalent in query syntax. Note that other "built-in" linq functions have no query syntax equivalent:
* `Skip`
* `Count`
* `Take`
* `Single`
* ... | YES!
```
var query = from a in dbContext.as.WhereIf(ListHasElements(Ids), s => Ids.Contains(s.Id.Value))
join b in dbContext.bs on a.Id.ToString() equals b.Id
join cin dbContext.cs on b.Id equals c.Id into bcJoin
from items in bcJoin.DefaultIfEmpty()
where b.Sent >= fromDate
whe... |
36,299,408 | I have a .php file and .js file. I want to use the `php` variable in `javascript` file but its not working. I found a solution by using session but that didn't worked.Can anybody provide me a solution or have a look at the code if there is any mistake.
In .php
```
$wd=500/$w;
$_SESSION['wd']=$wd;
```
In .js
```
... | 2016/03/30 | [
"https://Stackoverflow.com/questions/36299408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5009833/"
] | You can pass session value from php file to js by following method .
**php file :-**
```
$wd=500/$w;
$_SESSION['wd']=$wd;
echo '<script>var pf = '.json_encode($_SESSION['wd']).';</script>';
```
**Js file :-**
```
var sf = pf;
``` | You can simply pass the value through PHP like
```
$wd=500/$w;
$_SESSION['wd']=$wd;
echo '<script>var passedData = '.json_encode($_SESSION['wd']).';</script>';
```
And catch the the data in javascript like as
```
var sf = passedData;
``` |
17,001,849 | My dummy file looks like this:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
```
I want to get line if there is string `snow` in $3. I can do this like this:
```
awk '($3=="snow" || $3=="snowman") {print}' dummy_file
```
But there should be more simpler way. | 2013/06/08 | [
"https://Stackoverflow.com/questions/17001849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1286528/"
] | ```
awk '$3 ~ /snow/ { print }' dummy_file
``` | Maybe this will help
<http://www.math.utah.edu/docs/info/gawk_5.html>
```
awk '$3 ~ /snow|snowman/' dummy_file
``` |
17,001,849 | My dummy file looks like this:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
```
I want to get line if there is string `snow` in $3. I can do this like this:
```
awk '($3=="snow" || $3=="snowman") {print}' dummy_file
```
But there should be more simpler way. | 2013/06/08 | [
"https://Stackoverflow.com/questions/17001849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1286528/"
] | Maybe this will help
<http://www.math.utah.edu/docs/info/gawk_5.html>
```
awk '$3 ~ /snow|snowman/' dummy_file
``` | Print lines where the third field is either `snow` or `snowman` only:
```
awk '$3~/^snow(man)?$/' file
``` |
17,001,849 | My dummy file looks like this:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
```
I want to get line if there is string `snow` in $3. I can do this like this:
```
awk '($3=="snow" || $3=="snowman") {print}' dummy_file
```
But there should be more simpler way. | 2013/06/08 | [
"https://Stackoverflow.com/questions/17001849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1286528/"
] | Maybe this will help
<http://www.math.utah.edu/docs/info/gawk_5.html>
```
awk '$3 ~ /snow|snowman/' dummy_file
``` | ### GNU sed
```
sed '/\s*\(\S\+\s\+\)\{2\}\bsnow\(man\)\?\b/!d' file
```
Input:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
snow snow snowmanx
```
..output:
```
1 a snow
2 b snowman
``` |
17,001,849 | My dummy file looks like this:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
```
I want to get line if there is string `snow` in $3. I can do this like this:
```
awk '($3=="snow" || $3=="snowman") {print}' dummy_file
```
But there should be more simpler way. | 2013/06/08 | [
"https://Stackoverflow.com/questions/17001849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1286528/"
] | Also possible by looking for substring with index() function:
```
awk '(index($3, "snow") != 0) {print}' dummy_file
```
Shorter version:
```
awk 'index($3, "snow")' dummy_file
``` | Maybe this will help
<http://www.math.utah.edu/docs/info/gawk_5.html>
```
awk '$3 ~ /snow|snowman/' dummy_file
``` |
17,001,849 | My dummy file looks like this:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
```
I want to get line if there is string `snow` in $3. I can do this like this:
```
awk '($3=="snow" || $3=="snowman") {print}' dummy_file
```
But there should be more simpler way. | 2013/06/08 | [
"https://Stackoverflow.com/questions/17001849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1286528/"
] | ```
awk '$3 ~ /snow/ { print }' dummy_file
``` | Print lines where the third field is either `snow` or `snowman` only:
```
awk '$3~/^snow(man)?$/' file
``` |
17,001,849 | My dummy file looks like this:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
```
I want to get line if there is string `snow` in $3. I can do this like this:
```
awk '($3=="snow" || $3=="snowman") {print}' dummy_file
```
But there should be more simpler way. | 2013/06/08 | [
"https://Stackoverflow.com/questions/17001849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1286528/"
] | ```
awk '$3 ~ /snow/ { print }' dummy_file
``` | ### GNU sed
```
sed '/\s*\(\S\+\s\+\)\{2\}\bsnow\(man\)\?\b/!d' file
```
Input:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
snow snow snowmanx
```
..output:
```
1 a snow
2 b snowman
``` |
17,001,849 | My dummy file looks like this:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
```
I want to get line if there is string `snow` in $3. I can do this like this:
```
awk '($3=="snow" || $3=="snowman") {print}' dummy_file
```
But there should be more simpler way. | 2013/06/08 | [
"https://Stackoverflow.com/questions/17001849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1286528/"
] | ```
awk '$3 ~ /snow/ { print }' dummy_file
``` | Also possible by looking for substring with index() function:
```
awk '(index($3, "snow") != 0) {print}' dummy_file
```
Shorter version:
```
awk 'index($3, "snow")' dummy_file
``` |
17,001,849 | My dummy file looks like this:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
```
I want to get line if there is string `snow` in $3. I can do this like this:
```
awk '($3=="snow" || $3=="snowman") {print}' dummy_file
```
But there should be more simpler way. | 2013/06/08 | [
"https://Stackoverflow.com/questions/17001849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1286528/"
] | Print lines where the third field is either `snow` or `snowman` only:
```
awk '$3~/^snow(man)?$/' file
``` | ### GNU sed
```
sed '/\s*\(\S\+\s\+\)\{2\}\bsnow\(man\)\?\b/!d' file
```
Input:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
snow snow snowmanx
```
..output:
```
1 a snow
2 b snowman
``` |
17,001,849 | My dummy file looks like this:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
```
I want to get line if there is string `snow` in $3. I can do this like this:
```
awk '($3=="snow" || $3=="snowman") {print}' dummy_file
```
But there should be more simpler way. | 2013/06/08 | [
"https://Stackoverflow.com/questions/17001849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1286528/"
] | Also possible by looking for substring with index() function:
```
awk '(index($3, "snow") != 0) {print}' dummy_file
```
Shorter version:
```
awk 'index($3, "snow")' dummy_file
``` | Print lines where the third field is either `snow` or `snowman` only:
```
awk '$3~/^snow(man)?$/' file
``` |
17,001,849 | My dummy file looks like this:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
```
I want to get line if there is string `snow` in $3. I can do this like this:
```
awk '($3=="snow" || $3=="snowman") {print}' dummy_file
```
But there should be more simpler way. | 2013/06/08 | [
"https://Stackoverflow.com/questions/17001849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1286528/"
] | Also possible by looking for substring with index() function:
```
awk '(index($3, "snow") != 0) {print}' dummy_file
```
Shorter version:
```
awk 'index($3, "snow")' dummy_file
``` | ### GNU sed
```
sed '/\s*\(\S\+\s\+\)\{2\}\bsnow\(man\)\?\b/!d' file
```
Input:
```
C1 C2 C3
1 a snow
2 b snowman
snow c sowman
snow snow snowmanx
```
..output:
```
1 a snow
2 b snowman
``` |
47,561,687 | I have a class : Transaction.cs
```
public class Transaction
{
public int Transaction_id { get; set; }
public string Description { get; set; }
public string Item { get; set; }
}
```
I want too use reflection to get the values that are in the collection of transactions ie :
```
var db = new List<Transa... | 2017/11/29 | [
"https://Stackoverflow.com/questions/47561687",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8678071/"
] | Look for ports in CLOSE\_WAIT state in the `netstat` display. If you see lots, you have a resource leak in the server, which is not due to the clients. Conversely if you have lots of ports in FIN\_WAIT\_1 your server is closing but your clients aren't. Neither of these is exactly what you're looking for but they expose... | The solution was to use the ls command, as shown:
```
ls -al /proc/<PID>/fd
```
Using this with the wc counting utility
```
ls -al /proc/<PID>/fd | wc -l
```
Gives us a simple count of the # of resources (pipes, sockets, files) held open by a process.
We then could see that our client code needed a small adjus... |
4,545,126 | what is the simplest way to auto-submit form when the user click out side the div?
Just consider the div not the form elements.
```
<div id="formDiv">
<form id="search">
<input id="target" type="text" value="Field 1" />
<input type="text" value="Field 2" />
</form>
</div>
``` | 2010/12/28 | [
"https://Stackoverflow.com/questions/4545126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253169/"
] | You can add a `click` handler to `document` that *isn't* activated inside the `<div>`, like this:
```
$(document).click(function() {
$("#search").submit();
});
$("#formDiv").click(function(e) {
e.stopPropagation();
});
```
What this does, is any click on `document`, results in the `<form id="search">` being subm... | Write an onclick method in the parent element probably body element in your case and submit the form details. |
4,545,126 | what is the simplest way to auto-submit form when the user click out side the div?
Just consider the div not the form elements.
```
<div id="formDiv">
<form id="search">
<input id="target" type="text" value="Field 1" />
<input type="text" value="Field 2" />
</form>
</div>
``` | 2010/12/28 | [
"https://Stackoverflow.com/questions/4545126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253169/"
] | You can add a `click` handler to `document` that *isn't* activated inside the `<div>`, like this:
```
$(document).click(function() {
$("#search").submit();
});
$("#formDiv").click(function(e) {
e.stopPropagation();
});
```
What this does, is any click on `document`, results in the `<form id="search">` being subm... | ```
$(#'formDiv').click(function(){
return false;
});
$(document).click(function() {
$("#search").submit();
});
``` |
4,545,126 | what is the simplest way to auto-submit form when the user click out side the div?
Just consider the div not the form elements.
```
<div id="formDiv">
<form id="search">
<input id="target" type="text" value="Field 1" />
<input type="text" value="Field 2" />
</form>
</div>
``` | 2010/12/28 | [
"https://Stackoverflow.com/questions/4545126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253169/"
] | ```
$(#'formDiv').click(function(){
return false;
});
$(document).click(function() {
$("#search").submit();
});
``` | Write an onclick method in the parent element probably body element in your case and submit the form details. |
68,679 | I am testing various sorting algorithms. Right now I am testing shell sort, insertion sort and selection sort. I ran all three algorithms on a randomly-generated list of 1000 integers. The selection sort took 41 seconds, insertion sort took 34 seconds and shell sort sort took over 3 minutes. What can I do to improve my... | 2014/11/02 | [
"https://codereview.stackexchange.com/questions/68679",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/49759/"
] | `Show()` is probably slowing it down. It transforms your implementation into \$O(n^3)\$ and even worse increases the algorithm's time by (n\*[time taken to access and write to console stream]) in the last loop. Preparing your string and printing once to the console would increase the speed, even better, printing when t... | You should prefer the generic `IComparable<T>` to `IComparable`:
```
public static void InsertionSort<T>(T[] a) where T : IComparable<T>
public static void ShellSort<T>(T[] a) where T : IComparable<T>
public static void SelectionSort<T>(T[] a) where T : IComparable<T>
```
Note that we don't need a constraint on `T... |
25,499,386 | ```
/** Updates the notification. */
void updateNotification(String text) {
Log.i(TAG, text);
PendingIntent pi = PendingIntent.getActivity(getApplicationContext(), 0,
new Intent(getApplicationContext(), MainActivity.class),
PendingIntent.FLAG_UPDATE_CURRENT);
notification.setLat... | 2014/08/26 | [
"https://Stackoverflow.com/questions/25499386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3038899/"
] | I had encountered the exact same thing as well. I was using gulp and bower to give me the Slick Carousel plugin. I believe gulp and grunt are in many ways similar. Unfortunately, it's the plugin that's making the call for these files and it's 404'ing because its relative urls were no longer pointing to the right place ... | Seems like grunt build any CSS inside the final version, even if is not used. I had a main.scss file which i never import but it was that file style that was messing with the rest. |
25,499,386 | ```
/** Updates the notification. */
void updateNotification(String text) {
Log.i(TAG, text);
PendingIntent pi = PendingIntent.getActivity(getApplicationContext(), 0,
new Intent(getApplicationContext(), MainActivity.class),
PendingIntent.FLAG_UPDATE_CURRENT);
notification.setLat... | 2014/08/26 | [
"https://Stackoverflow.com/questions/25499386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3038899/"
] | I had encountered the exact same thing as well. I was using gulp and bower to give me the Slick Carousel plugin. I believe gulp and grunt are in many ways similar. Unfortunately, it's the plugin that's making the call for these files and it's 404'ing because its relative urls were no longer pointing to the right place ... | OK so I'm not able to add a comment as my reputation isn't high enough yet. So I was going to ask if you were using angular-fullstack generator. I had a similar error when I was working with this generator. I never could determine the exact cause...except that it has to deal with the `<!-- injector:js -->` I spent hour... |
25,499,386 | ```
/** Updates the notification. */
void updateNotification(String text) {
Log.i(TAG, text);
PendingIntent pi = PendingIntent.getActivity(getApplicationContext(), 0,
new Intent(getApplicationContext(), MainActivity.class),
PendingIntent.FLAG_UPDATE_CURRENT);
notification.setLat... | 2014/08/26 | [
"https://Stackoverflow.com/questions/25499386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3038899/"
] | I had encountered the exact same thing as well. I was using gulp and bower to give me the Slick Carousel plugin. I believe gulp and grunt are in many ways similar. Unfortunately, it's the plugin that's making the call for these files and it's 404'ing because its relative urls were no longer pointing to the right place ... | I think you should check the Grunt File where the Copy option is there you can see the components copied at the grunt serve:dist command see src:[...
```
copy:
dist:
files: [
expand: true
dot: true
cwd: "<%= yeoman.app %>"
dest: "<%= ... |
13,604 | So it seems that we have three basic issues (and possibly more but not as prevalent):
1. Pilots can crash planes. Someone can just be suicidal, be part of an extremist/terrorist group, can have a vendetta against someone or just thinks might as well take more down with me.
2. Passengers that get into the cockpits. I k... | 2015/03/28 | [
"https://aviation.stackexchange.com/questions/13604",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/4040/"
] | First two items in your list are part of class of crash issues so called "controlled flight into terrain" which is part of "human factor" issues.
The only way to avoid such crashes is to create airplane without pilots at all, that is what Google try to do with automobiles. And I believe there are no technical problem... | Requiring two pilots in the cockpit at all times.
I am not sure that counts as a technological solution however.
You could imagine they could put emergency intercoms to air traffic control outside the cockpit and allow air traffic control to take control of an aircraft in an emergency. Or at least to remotely open t... |
13,604 | So it seems that we have three basic issues (and possibly more but not as prevalent):
1. Pilots can crash planes. Someone can just be suicidal, be part of an extremist/terrorist group, can have a vendetta against someone or just thinks might as well take more down with me.
2. Passengers that get into the cockpits. I k... | 2015/03/28 | [
"https://aviation.stackexchange.com/questions/13604",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/4040/"
] | You can't. There exists no technical solution to this problem, aside from removing pilots entirely from flight decks. Pilotless aircraft would prevent this, but that's not "stopping the pilot from crashing the plane," it's removing the pilot entirely (and is then more vulnerable to unforseen situations, unless there's ... | Other than background checks and rules of practice about who is allowed to fly what when and who can/must be in the cockpit, **no technical measures** are currently being moved forward for that.
I don't think I'd want to have such technical measures in place, either. Sometimes, a pilot *needs* to crash-land an airplan... |
13,604 | So it seems that we have three basic issues (and possibly more but not as prevalent):
1. Pilots can crash planes. Someone can just be suicidal, be part of an extremist/terrorist group, can have a vendetta against someone or just thinks might as well take more down with me.
2. Passengers that get into the cockpits. I k... | 2015/03/28 | [
"https://aviation.stackexchange.com/questions/13604",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/4040/"
] | Nothing.
At present, there are no serious technological plans to prevent pilots from intentionally crashing a plane. There are discussions about making sure that there are always two people in the cockpit, and at some point policies might be changed to make it easier for pilots to enter the cockpit (even if no-one in... | Systems exist to avoid [CFIT](http://en.wikipedia.org/wiki/Controlled_flight_into_terrain) (controlled flight into terrain). This has been the leading cause of fatalities in the last 50 years: Intact planes being flown into the ground or mountain sides by disoriented pilots and wrongly entered data. Precise navigation ... |
13,604 | So it seems that we have three basic issues (and possibly more but not as prevalent):
1. Pilots can crash planes. Someone can just be suicidal, be part of an extremist/terrorist group, can have a vendetta against someone or just thinks might as well take more down with me.
2. Passengers that get into the cockpits. I k... | 2015/03/28 | [
"https://aviation.stackexchange.com/questions/13604",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/4040/"
] | Systems exist to avoid [CFIT](http://en.wikipedia.org/wiki/Controlled_flight_into_terrain) (controlled flight into terrain). This has been the leading cause of fatalities in the last 50 years: Intact planes being flown into the ground or mountain sides by disoriented pilots and wrongly entered data. Precise navigation ... | First two items in your list are part of class of crash issues so called "controlled flight into terrain" which is part of "human factor" issues.
The only way to avoid such crashes is to create airplane without pilots at all, that is what Google try to do with automobiles. And I believe there are no technical problem... |
13,604 | So it seems that we have three basic issues (and possibly more but not as prevalent):
1. Pilots can crash planes. Someone can just be suicidal, be part of an extremist/terrorist group, can have a vendetta against someone or just thinks might as well take more down with me.
2. Passengers that get into the cockpits. I k... | 2015/03/28 | [
"https://aviation.stackexchange.com/questions/13604",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/4040/"
] | Nothing.
At present, there are no serious technological plans to prevent pilots from intentionally crashing a plane. There are discussions about making sure that there are always two people in the cockpit, and at some point policies might be changed to make it easier for pilots to enter the cockpit (even if no-one in... | Requiring two pilots in the cockpit at all times.
I am not sure that counts as a technological solution however.
You could imagine they could put emergency intercoms to air traffic control outside the cockpit and allow air traffic control to take control of an aircraft in an emergency. Or at least to remotely open t... |
13,604 | So it seems that we have three basic issues (and possibly more but not as prevalent):
1. Pilots can crash planes. Someone can just be suicidal, be part of an extremist/terrorist group, can have a vendetta against someone or just thinks might as well take more down with me.
2. Passengers that get into the cockpits. I k... | 2015/03/28 | [
"https://aviation.stackexchange.com/questions/13604",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/4040/"
] | You can't. There exists no technical solution to this problem, aside from removing pilots entirely from flight decks. Pilotless aircraft would prevent this, but that's not "stopping the pilot from crashing the plane," it's removing the pilot entirely (and is then more vulnerable to unforseen situations, unless there's ... | Requiring two pilots in the cockpit at all times.
I am not sure that counts as a technological solution however.
You could imagine they could put emergency intercoms to air traffic control outside the cockpit and allow air traffic control to take control of an aircraft in an emergency. Or at least to remotely open t... |
13,604 | So it seems that we have three basic issues (and possibly more but not as prevalent):
1. Pilots can crash planes. Someone can just be suicidal, be part of an extremist/terrorist group, can have a vendetta against someone or just thinks might as well take more down with me.
2. Passengers that get into the cockpits. I k... | 2015/03/28 | [
"https://aviation.stackexchange.com/questions/13604",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/4040/"
] | Other than background checks and rules of practice about who is allowed to fly what when and who can/must be in the cockpit, **no technical measures** are currently being moved forward for that.
I don't think I'd want to have such technical measures in place, either. Sometimes, a pilot *needs* to crash-land an airplan... | Requiring two pilots in the cockpit at all times.
I am not sure that counts as a technological solution however.
You could imagine they could put emergency intercoms to air traffic control outside the cockpit and allow air traffic control to take control of an aircraft in an emergency. Or at least to remotely open t... |
13,604 | So it seems that we have three basic issues (and possibly more but not as prevalent):
1. Pilots can crash planes. Someone can just be suicidal, be part of an extremist/terrorist group, can have a vendetta against someone or just thinks might as well take more down with me.
2. Passengers that get into the cockpits. I k... | 2015/03/28 | [
"https://aviation.stackexchange.com/questions/13604",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/4040/"
] | Systems exist to avoid [CFIT](http://en.wikipedia.org/wiki/Controlled_flight_into_terrain) (controlled flight into terrain). This has been the leading cause of fatalities in the last 50 years: Intact planes being flown into the ground or mountain sides by disoriented pilots and wrongly entered data. Precise navigation ... | Other than background checks and rules of practice about who is allowed to fly what when and who can/must be in the cockpit, **no technical measures** are currently being moved forward for that.
I don't think I'd want to have such technical measures in place, either. Sometimes, a pilot *needs* to crash-land an airplan... |
13,604 | So it seems that we have three basic issues (and possibly more but not as prevalent):
1. Pilots can crash planes. Someone can just be suicidal, be part of an extremist/terrorist group, can have a vendetta against someone or just thinks might as well take more down with me.
2. Passengers that get into the cockpits. I k... | 2015/03/28 | [
"https://aviation.stackexchange.com/questions/13604",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/4040/"
] | You can't. There exists no technical solution to this problem, aside from removing pilots entirely from flight decks. Pilotless aircraft would prevent this, but that's not "stopping the pilot from crashing the plane," it's removing the pilot entirely (and is then more vulnerable to unforseen situations, unless there's ... | First two items in your list are part of class of crash issues so called "controlled flight into terrain" which is part of "human factor" issues.
The only way to avoid such crashes is to create airplane without pilots at all, that is what Google try to do with automobiles. And I believe there are no technical problem... |
13,604 | So it seems that we have three basic issues (and possibly more but not as prevalent):
1. Pilots can crash planes. Someone can just be suicidal, be part of an extremist/terrorist group, can have a vendetta against someone or just thinks might as well take more down with me.
2. Passengers that get into the cockpits. I k... | 2015/03/28 | [
"https://aviation.stackexchange.com/questions/13604",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/4040/"
] | Nothing.
At present, there are no serious technological plans to prevent pilots from intentionally crashing a plane. There are discussions about making sure that there are always two people in the cockpit, and at some point policies might be changed to make it easier for pilots to enter the cockpit (even if no-one in... | Other than background checks and rules of practice about who is allowed to fly what when and who can/must be in the cockpit, **no technical measures** are currently being moved forward for that.
I don't think I'd want to have such technical measures in place, either. Sometimes, a pilot *needs* to crash-land an airplan... |
27,939,437 | I have installed VisualStudio 2013 Community, as per Microsoft documentation [VisualStudio 2013 Community](https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) is free and will not require any license.
But today I saw a notification on VisualStudio 2013 community IDE prompting me to update the trial lice... | 2015/01/14 | [
"https://Stackoverflow.com/questions/27939437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3505170/"
] | Actually there is a dirty work around without signing-in , I used a free tool called **RunAsDate** from this link <http://www.nirsoft.net/utils/run_as_date.html> and set the date in the tool to the installation date. So the license never expires . | Have you signed in to Community?
Mean in your editor aswell on the homepage if necessary.
That should update the license and fix that. If you need to sign out after that you can. The license should be good for one year before you need to sign in again.
Otherwise it's a problem that you should address to the Microsof... |
27,939,437 | I have installed VisualStudio 2013 Community, as per Microsoft documentation [VisualStudio 2013 Community](https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) is free and will not require any license.
But today I saw a notification on VisualStudio 2013 community IDE prompting me to update the trial lice... | 2015/01/14 | [
"https://Stackoverflow.com/questions/27939437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3505170/"
] | Have you signed in to Community?
Mean in your editor aswell on the homepage if necessary.
That should update the license and fix that. If you need to sign out after that you can. The license should be good for one year before you need to sign in again.
Otherwise it's a problem that you should address to the Microsof... | I had the same issue. I signed out of visual studio, and restarted my PC. That solved the issue.
Hope this helps |
27,939,437 | I have installed VisualStudio 2013 Community, as per Microsoft documentation [VisualStudio 2013 Community](https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) is free and will not require any license.
But today I saw a notification on VisualStudio 2013 community IDE prompting me to update the trial lice... | 2015/01/14 | [
"https://Stackoverflow.com/questions/27939437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3505170/"
] | Have you signed in to Community?
Mean in your editor aswell on the homepage if necessary.
That should update the license and fix that. If you need to sign out after that you can. The license should be good for one year before you need to sign in again.
Otherwise it's a problem that you should address to the Microsof... | I had to install *VStudio 2013 **Community*** yesterday *2017 / 07 / 11* (*170711*), and I ran into the exact same issue.
Some context (I doubt that it makes any difference, but still):
* I have ***7*** other *VStudio* versions (paid / unpaid) installed
* Previously, I had a *VStudio 2013* paid edition (I don't remem... |
27,939,437 | I have installed VisualStudio 2013 Community, as per Microsoft documentation [VisualStudio 2013 Community](https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) is free and will not require any license.
But today I saw a notification on VisualStudio 2013 community IDE prompting me to update the trial lice... | 2015/01/14 | [
"https://Stackoverflow.com/questions/27939437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3505170/"
] | Have you signed in to Community?
Mean in your editor aswell on the homepage if necessary.
That should update the license and fix that. If you need to sign out after that you can. The license should be good for one year before you need to sign in again.
Otherwise it's a problem that you should address to the Microsof... | I faced the same problem today with Visual Studio Community 2019. The warning disappeared after logout and login again from my Visual Studio account and restart it.
[](https://i.stack.imgur.com/wjqSj.png) |
27,939,437 | I have installed VisualStudio 2013 Community, as per Microsoft documentation [VisualStudio 2013 Community](https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) is free and will not require any license.
But today I saw a notification on VisualStudio 2013 community IDE prompting me to update the trial lice... | 2015/01/14 | [
"https://Stackoverflow.com/questions/27939437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3505170/"
] | Actually there is a dirty work around without signing-in , I used a free tool called **RunAsDate** from this link <http://www.nirsoft.net/utils/run_as_date.html> and set the date in the tool to the installation date. So the license never expires . | I had the same issue. I signed out of visual studio, and restarted my PC. That solved the issue.
Hope this helps |
27,939,437 | I have installed VisualStudio 2013 Community, as per Microsoft documentation [VisualStudio 2013 Community](https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) is free and will not require any license.
But today I saw a notification on VisualStudio 2013 community IDE prompting me to update the trial lice... | 2015/01/14 | [
"https://Stackoverflow.com/questions/27939437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3505170/"
] | Actually there is a dirty work around without signing-in , I used a free tool called **RunAsDate** from this link <http://www.nirsoft.net/utils/run_as_date.html> and set the date in the tool to the installation date. So the license never expires . | I had to install *VStudio 2013 **Community*** yesterday *2017 / 07 / 11* (*170711*), and I ran into the exact same issue.
Some context (I doubt that it makes any difference, but still):
* I have ***7*** other *VStudio* versions (paid / unpaid) installed
* Previously, I had a *VStudio 2013* paid edition (I don't remem... |
27,939,437 | I have installed VisualStudio 2013 Community, as per Microsoft documentation [VisualStudio 2013 Community](https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) is free and will not require any license.
But today I saw a notification on VisualStudio 2013 community IDE prompting me to update the trial lice... | 2015/01/14 | [
"https://Stackoverflow.com/questions/27939437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3505170/"
] | Actually there is a dirty work around without signing-in , I used a free tool called **RunAsDate** from this link <http://www.nirsoft.net/utils/run_as_date.html> and set the date in the tool to the installation date. So the license never expires . | I faced the same problem today with Visual Studio Community 2019. The warning disappeared after logout and login again from my Visual Studio account and restart it.
[](https://i.stack.imgur.com/wjqSj.png) |
27,939,437 | I have installed VisualStudio 2013 Community, as per Microsoft documentation [VisualStudio 2013 Community](https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) is free and will not require any license.
But today I saw a notification on VisualStudio 2013 community IDE prompting me to update the trial lice... | 2015/01/14 | [
"https://Stackoverflow.com/questions/27939437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3505170/"
] | I had to install *VStudio 2013 **Community*** yesterday *2017 / 07 / 11* (*170711*), and I ran into the exact same issue.
Some context (I doubt that it makes any difference, but still):
* I have ***7*** other *VStudio* versions (paid / unpaid) installed
* Previously, I had a *VStudio 2013* paid edition (I don't remem... | I had the same issue. I signed out of visual studio, and restarted my PC. That solved the issue.
Hope this helps |
27,939,437 | I have installed VisualStudio 2013 Community, as per Microsoft documentation [VisualStudio 2013 Community](https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx) is free and will not require any license.
But today I saw a notification on VisualStudio 2013 community IDE prompting me to update the trial lice... | 2015/01/14 | [
"https://Stackoverflow.com/questions/27939437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3505170/"
] | I had to install *VStudio 2013 **Community*** yesterday *2017 / 07 / 11* (*170711*), and I ran into the exact same issue.
Some context (I doubt that it makes any difference, but still):
* I have ***7*** other *VStudio* versions (paid / unpaid) installed
* Previously, I had a *VStudio 2013* paid edition (I don't remem... | I faced the same problem today with Visual Studio Community 2019. The warning disappeared after logout and login again from my Visual Studio account and restart it.
[](https://i.stack.imgur.com/wjqSj.png) |
1,074,986 | Why does not $ \int\_{b}^{a} 2\pi \,f(x) \,dx $ yield the correct answer when calculating the surface area of a solid of revolution? | 2014/12/19 | [
"https://math.stackexchange.com/questions/1074986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/195581/"
] | Because the 'infinitesimal' line element which you are rotating about a circle of circumference $2\pi f(x)$ doesn't have length $dx$; rather the length is $\sqrt{1 + f'(x)^2} \ dx$, which is always longer for any $x$ for which $f'(x) \neq 0$.
For a cylinder where $f(x)$ is a constant, then $f'(x) = 0$ and your propose... | For a thin slice surface area of a cone = $ 2 \pi \,f(x) \,ds $ which you should integrate.
If it is a flat disc of height tending to zero there would be a big error without multiplying by $ \sec \phi $ due to slope.
$ \int\_{b}^{a} 2\pi \,f(x) \,dx $ yields correct answer only when calculating the surface area of ... |
38,191,543 | I have an xml-file with products.
I have split it up into a table with one row for each product with product number and xml
```
SKU | xml
----|-------
1111|<product><price>123</price....</product>
1112|<product><price>345</price....</product>
```
The attributes are stored like this:
```xml
<attribute-list>
<at... | 2016/07/04 | [
"https://Stackoverflow.com/questions/38191543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1678652/"
] | Is this what you're looking for? This statement lists all `@name` attributes for each attribute, and then also grabs the actual `Value` as well as the `@DefaultValue` from the `<Value>` subnode:
```
SELECT DISTINCT
AttrName = XC.value('@name', 'varchar(50)'),
DefaultValue=XC.value('(value/@default)[1]', 'va... | Solution based on @mark\_s
```sql
SELECT distinct AttrName = attr.value('@name', 'varchar(50)')
FROM product_xml
CROSS APPLY xml.nodes('/product/attribute-list/attribute') as T2(attr)
``` |
73,608,767 | I am trying to udnerstand the concept of map function in swift. I want to iterate an array of array in such a way that I can print each element in every array along with it's index.
Below is my code
```
var raceResults = [["one","two","four"],["two","one","five","six"],["two","one","four","ten"],["one","two","four"]]
... | 2022/09/05 | [
"https://Stackoverflow.com/questions/73608767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1845926/"
] | Use the `[uri]` type accelerator. Like so,
```
$u = [uri]"http://localhost:9200/index"
$u.LocalPath # Get the local path property
/index
```
Since accelerator creates an Uri obect, it works with more complex urls too. E.g.
```
$u = [uri]"http://localhost:9200/index/data.htm?foo=bar&qaz=zof"
$u # Print members, some... | Split-Path returns a specified part of a (file) path and in Windows the directories are separated using a backslash. If you run the same command on Linux, you will probably get the desired output.
The best way would probably be the [solution from Mathias](https://stackoverflow.com/questions/73608732/powershell-split-p... |
73,608,767 | I am trying to udnerstand the concept of map function in swift. I want to iterate an array of array in such a way that I can print each element in every array along with it's index.
Below is my code
```
var raceResults = [["one","two","four"],["two","one","five","six"],["two","one","four","ten"],["one","two","four"]]
... | 2022/09/05 | [
"https://Stackoverflow.com/questions/73608767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1845926/"
] | `Split-Path` works with [provider](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_providers?view=powershell-7.2) paths only. Instead, use the .NET class [`Uri`](https://learn.microsoft.com/en-us/dotnet/api/system.uri?view=net-6.0) that is specifically made for parsing URIs.
U... | Split-Path returns a specified part of a (file) path and in Windows the directories are separated using a backslash. If you run the same command on Linux, you will probably get the desired output.
The best way would probably be the [solution from Mathias](https://stackoverflow.com/questions/73608732/powershell-split-p... |
73,608,767 | I am trying to udnerstand the concept of map function in swift. I want to iterate an array of array in such a way that I can print each element in every array along with it's index.
Below is my code
```
var raceResults = [["one","two","four"],["two","one","five","six"],["two","one","four","ten"],["one","two","four"]]
... | 2022/09/05 | [
"https://Stackoverflow.com/questions/73608767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1845926/"
] | Use the `[uri]` type accelerator. Like so,
```
$u = [uri]"http://localhost:9200/index"
$u.LocalPath # Get the local path property
/index
```
Since accelerator creates an Uri obect, it works with more complex urls too. E.g.
```
$u = [uri]"http://localhost:9200/index/data.htm?foo=bar&qaz=zof"
$u # Print members, some... | `Split-Path` works with [provider](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_providers?view=powershell-7.2) paths only. Instead, use the .NET class [`Uri`](https://learn.microsoft.com/en-us/dotnet/api/system.uri?view=net-6.0) that is specifically made for parsing URIs.
U... |
11,071,287 | Is it possible to write an application using the `pyjamas` widgets, together with the `tornado` server model? What I have in mind is to provide a desktop-like frontend for my web application with `pyjamas`, and do server side logic with tornado.
Specifically, I want to trigger events in the web application generated i... | 2012/06/17 | [
"https://Stackoverflow.com/questions/11071287",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/647991/"
] | Dependency properties provide built in change notification for when a property changes which means WPF knows when a controls value has changed.
Your ViewModel types do not, by default, provide any mechanism for change notification so if they don't support either of these options how is the view supposed to know when ... | First: You do not need to use `INotifyPropertyChanged` or `DependencyObject` at all.
But, and this is the central point in using Binding, there is some Pub / Sub Mechanism in
the Binding, which is listening to those `PropertyChanged` events and doing the update
of the view in case a relevant property for Binding has c... |
11,071,287 | Is it possible to write an application using the `pyjamas` widgets, together with the `tornado` server model? What I have in mind is to provide a desktop-like frontend for my web application with `pyjamas`, and do server side logic with tornado.
Specifically, I want to trigger events in the web application generated i... | 2012/06/17 | [
"https://Stackoverflow.com/questions/11071287",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/647991/"
] | First: You do not need to use `INotifyPropertyChanged` or `DependencyObject` at all.
But, and this is the central point in using Binding, there is some Pub / Sub Mechanism in
the Binding, which is listening to those `PropertyChanged` events and doing the update
of the view in case a relevant property for Binding has c... | `INotiyfyPropertyChanged` - This property we used in the viewmodel so that if there happens any changes in the UI this property will reflect those changes. |
11,071,287 | Is it possible to write an application using the `pyjamas` widgets, together with the `tornado` server model? What I have in mind is to provide a desktop-like frontend for my web application with `pyjamas`, and do server side logic with tornado.
Specifically, I want to trigger events in the web application generated i... | 2012/06/17 | [
"https://Stackoverflow.com/questions/11071287",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/647991/"
] | Dependency properties provide built in change notification for when a property changes which means WPF knows when a controls value has changed.
Your ViewModel types do not, by default, provide any mechanism for change notification so if they don't support either of these options how is the view supposed to know when ... | `INotiyfyPropertyChanged` - This property we used in the viewmodel so that if there happens any changes in the UI this property will reflect those changes. |
9,933,964 | Is there a way to integrate Git into the Windows cmd or PowerShell? - so that it feels a bit like a Linux terminal. How? | 2012/03/29 | [
"https://Stackoverflow.com/questions/9933964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570168/"
] | This is what I use: [posh-git: a PowerShell environment for Git](https://github.com/dahlbyk/posh-git)
It also integrates into the cwd line:
[](https://i.stack.imgur.com/28hIg.png) | Simple and straightforward way:
*[Step by Step guide](http://thepracticalsysadmin.com/setting-up-git-in-windows/)*
Essentially
1. Add Git binaries to the system path |
9,933,964 | Is there a way to integrate Git into the Windows cmd or PowerShell? - so that it feels a bit like a Linux terminal. How? | 2012/03/29 | [
"https://Stackoverflow.com/questions/9933964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570168/"
] | This is what I use: [posh-git: a PowerShell environment for Git](https://github.com/dahlbyk/posh-git)
It also integrates into the cwd line:
[](https://i.stack.imgur.com/28hIg.png) | Check out Posh Git:
* *[Better Git with PowerShell](http://haacked.com/archive/2011/12/13/better-git-with-powershell.aspx)*
* *[Configure Git in PowerShell So You Don’t Have to Enter Your Password All the Damn Time](https://haacked.com/archive/2011/12/19/get-git-for-windows.aspx/)* |
9,933,964 | Is there a way to integrate Git into the Windows cmd or PowerShell? - so that it feels a bit like a Linux terminal. How? | 2012/03/29 | [
"https://Stackoverflow.com/questions/9933964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570168/"
] | Download and install Git as shown in [**the link**](http://help.github.com/win-set-up-git/). In the **sixth** slide, 'Adjusting your PATH environment.', check for the option **'Run Git and included Unix tools from the Windows command prompt'** and that's it! | why everybody here wants to literally "integrate" git into powershell?
1. in powershell type `git`
2. now you are in bash (otherwise you don't have git as an env var)
but if you really want an integration, the easiest way is to "Download and install posh-git" |
9,933,964 | Is there a way to integrate Git into the Windows cmd or PowerShell? - so that it feels a bit like a Linux terminal. How? | 2012/03/29 | [
"https://Stackoverflow.com/questions/9933964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570168/"
] | Download and install Git as shown in [**the link**](http://help.github.com/win-set-up-git/). In the **sixth** slide, 'Adjusting your PATH environment.', check for the option **'Run Git and included Unix tools from the Windows command prompt'** and that's it! | This is what I use: [posh-git: a PowerShell environment for Git](https://github.com/dahlbyk/posh-git)
It also integrates into the cwd line:
[](https://i.stack.imgur.com/28hIg.png) |
9,933,964 | Is there a way to integrate Git into the Windows cmd or PowerShell? - so that it feels a bit like a Linux terminal. How? | 2012/03/29 | [
"https://Stackoverflow.com/questions/9933964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570168/"
] | OK, I got it myself ...
```
new-item -path alias:git -value 'C:\Program Files (x86)\Git\bin\git.exe'
``` | why everybody here wants to literally "integrate" git into powershell?
1. in powershell type `git`
2. now you are in bash (otherwise you don't have git as an env var)
but if you really want an integration, the easiest way is to "Download and install posh-git" |
9,933,964 | Is there a way to integrate Git into the Windows cmd or PowerShell? - so that it feels a bit like a Linux terminal. How? | 2012/03/29 | [
"https://Stackoverflow.com/questions/9933964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570168/"
] | Check out Posh Git:
* *[Better Git with PowerShell](http://haacked.com/archive/2011/12/13/better-git-with-powershell.aspx)*
* *[Configure Git in PowerShell So You Don’t Have to Enter Your Password All the Damn Time](https://haacked.com/archive/2011/12/19/get-git-for-windows.aspx/)* | why everybody here wants to literally "integrate" git into powershell?
1. in powershell type `git`
2. now you are in bash (otherwise you don't have git as an env var)
but if you really want an integration, the easiest way is to "Download and install posh-git" |
9,933,964 | Is there a way to integrate Git into the Windows cmd or PowerShell? - so that it feels a bit like a Linux terminal. How? | 2012/03/29 | [
"https://Stackoverflow.com/questions/9933964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570168/"
] | Download and install Git as shown in [**the link**](http://help.github.com/win-set-up-git/). In the **sixth** slide, 'Adjusting your PATH environment.', check for the option **'Run Git and included Unix tools from the Windows command prompt'** and that's it! | OK, I got it myself ...
```
new-item -path alias:git -value 'C:\Program Files (x86)\Git\bin\git.exe'
``` |
9,933,964 | Is there a way to integrate Git into the Windows cmd or PowerShell? - so that it feels a bit like a Linux terminal. How? | 2012/03/29 | [
"https://Stackoverflow.com/questions/9933964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570168/"
] | Download and install Git as shown in [**the link**](http://help.github.com/win-set-up-git/). In the **sixth** slide, 'Adjusting your PATH environment.', check for the option **'Run Git and included Unix tools from the Windows command prompt'** and that's it! | Check out Posh Git:
* *[Better Git with PowerShell](http://haacked.com/archive/2011/12/13/better-git-with-powershell.aspx)*
* *[Configure Git in PowerShell So You Don’t Have to Enter Your Password All the Damn Time](https://haacked.com/archive/2011/12/19/get-git-for-windows.aspx/)* |
9,933,964 | Is there a way to integrate Git into the Windows cmd or PowerShell? - so that it feels a bit like a Linux terminal. How? | 2012/03/29 | [
"https://Stackoverflow.com/questions/9933964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570168/"
] | Download and install Git as shown in [**the link**](http://help.github.com/win-set-up-git/). In the **sixth** slide, 'Adjusting your PATH environment.', check for the option **'Run Git and included Unix tools from the Windows command prompt'** and that's it! | Simple and straightforward way:
*[Step by Step guide](http://thepracticalsysadmin.com/setting-up-git-in-windows/)*
Essentially
1. Add Git binaries to the system path |
9,933,964 | Is there a way to integrate Git into the Windows cmd or PowerShell? - so that it feels a bit like a Linux terminal. How? | 2012/03/29 | [
"https://Stackoverflow.com/questions/9933964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570168/"
] | Simple and straightforward way:
*[Step by Step guide](http://thepracticalsysadmin.com/setting-up-git-in-windows/)*
Essentially
1. Add Git binaries to the system path | why everybody here wants to literally "integrate" git into powershell?
1. in powershell type `git`
2. now you are in bash (otherwise you don't have git as an env var)
but if you really want an integration, the easiest way is to "Download and install posh-git" |
58,842,025 | **Hi**, to everyone who reads this,
I've trying to read out a **UserId** from my MySql Database.
I want to use the result in the next SQL statement which should
add the `Id` into another table. The problem is I've no idea how to do that.
Here I've tried to select the row **"UserId"** from my **`accounts`**... | 2019/11/13 | [
"https://Stackoverflow.com/questions/58842025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | One way to approach this would be to take the *function* as another parameter.
Similar to your FunctionOne, FunctionTwo etc. you could have `FunctionX` which does the common work and calls the passed function which, as a parameter, can be varied by the caller.
That would look something like this:
```
// added 'fn', ... | So,
* By doing this:
```
five = this.FunctionTwo(two, three, four, five)
```
you calling function 'FunctionTwo' with params (two, three, four, five) and assigning result of function 'FunctionTwo' to variable 'five'
* By doing this:
```
five = this.FunctionTwo
```
you are assigning function 'FunctionTwo' instan... |
567,138 | Let $X$ be a random variable on the probability space $(\Omega,\mathcal B,P)$, with distribution $P\_{X}$. Consider the random variable $\hat X$ on the probability space $(\mathbb R,\mathcal B\_{\mathbb R},P\_{X})$,defined by $\hat X(x)=x$ . Then $P\_{\hat X}=P\_{X}$.
$\mathcal B $ is $\sigma$-algebra.
thanks for hel... | 2013/11/14 | [
"https://math.stackexchange.com/questions/567138",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/108367/"
] | If $X$ is a random variable on $(\Omega,\mathcal{B},P)$ with distribution $P\_X$, and $Y$ defined on $(\mathbb{R},\mathcal{B}(\mathbb{R}),P\_X)$ by $Y(x)=x$ for $x\in\mathbb{R}$, then
$$
(P\_X)\_Y=P\_X,
$$
i.e. the distribution of $Y$ under $P\_X$ is exactly $P\_X$. This is pretty obvious from the definition of $(P\_X)... | $P\_X$ and $P\_{\hat{X}}$ are probability measures on the Borel sets, so we just need to check that they are equal on arbitrary Borel sets $E$.
So $P\_{\hat{X}}(E)$ is defined to be $P\_X(\{x\in\mathbb{R}|\hat{X}(x) \in E\})=P\_X(\{x\in\mathbb{R}|x \in E\}) = P\_X(E)$ |
65,556,345 | I am trying to integrate google ads to my react native app, so I followed everything from the official docs [https://rnfirebase.io/](https://rnfirebase.io/admob/usage) and I managed to display google ads.
but when it comes to European User Consent I cant display the Google-rendered consent because the result of the met... | 2021/01/04 | [
"https://Stackoverflow.com/questions/65556345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9604850/"
] | You would need to iterate over all checkboxes to see if any are checked each time. Or you can use a selector for it like this:
```js
function terms_changed(termsCheckBox){
document.getElementById("submit_button").disabled = !termsCheckBox.parentElement.querySelectorAll("input[type=checkbox]:checked").length;
... | ```js
// get parent element which is a div and then get all checkboxes
// check if any of them is checked.
function terms_changed(termsCheckBox) {
document.getElementById("submit_button").disabled = !([...termsCheckBox.parentElement.querySelectorAll("input[type=checkbox]")].some(cb => cb.checked));
}
```
```html
<fo... |
65,556,345 | I am trying to integrate google ads to my react native app, so I followed everything from the official docs [https://rnfirebase.io/](https://rnfirebase.io/admob/usage) and I managed to display google ads.
but when it comes to European User Consent I cant display the Google-rendered consent because the result of the met... | 2021/01/04 | [
"https://Stackoverflow.com/questions/65556345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9604850/"
] | You would need to iterate over all checkboxes to see if any are checked each time. Or you can use a selector for it like this:
```js
function terms_changed(termsCheckBox){
document.getElementById("submit_button").disabled = !termsCheckBox.parentElement.querySelectorAll("input[type=checkbox]:checked").length;
... | Made some minor changes to the HTML, the attribute values should be in quotes, for example: `id="cb1"`
You can avoid using an onclick attribute on every checkbox by using event delegation that checks the whole form on any click. This can be streamlined to check more specifically, perhaps using `[name="uuid[]"]`
```js... |
65,556,345 | I am trying to integrate google ads to my react native app, so I followed everything from the official docs [https://rnfirebase.io/](https://rnfirebase.io/admob/usage) and I managed to display google ads.
but when it comes to European User Consent I cant display the Google-rendered consent because the result of the met... | 2021/01/04 | [
"https://Stackoverflow.com/questions/65556345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9604850/"
] | You would need to iterate over all checkboxes to see if any are checked each time. Or you can use a selector for it like this:
```js
function terms_changed(termsCheckBox){
document.getElementById("submit_button").disabled = !termsCheckBox.parentElement.querySelectorAll("input[type=checkbox]:checked").length;
... | If there's a slight chance to reformat HTML, you could apply this functionality only with CSS. Hence I'll post my answer since it differs from all the JS solutions offered here:
```css
button {
background-color: #c0c0c0;
color: GrayText;
border: 2px outset ButtonFace;
pointer-events: none;
}
input:checked ~ d... |
65,556,345 | I am trying to integrate google ads to my react native app, so I followed everything from the official docs [https://rnfirebase.io/](https://rnfirebase.io/admob/usage) and I managed to display google ads.
but when it comes to European User Consent I cant display the Google-rendered consent because the result of the met... | 2021/01/04 | [
"https://Stackoverflow.com/questions/65556345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9604850/"
] | You would need to iterate over all checkboxes to see if any are checked each time. Or you can use a selector for it like this:
```js
function terms_changed(termsCheckBox){
document.getElementById("submit_button").disabled = !termsCheckBox.parentElement.querySelectorAll("input[type=checkbox]:checked").length;
... | With a bit of reactive programming fun:
* Each `click(...)` return a stream that emits a boolean after each click. True if the checkbox is checked, false otherwise. Starts with false.
* Combine all streams into one. It emits the status of all checkboxes every time one changes.
* Disable button if all checkboxes are un... |
65,556,345 | I am trying to integrate google ads to my react native app, so I followed everything from the official docs [https://rnfirebase.io/](https://rnfirebase.io/admob/usage) and I managed to display google ads.
but when it comes to European User Consent I cant display the Google-rendered consent because the result of the met... | 2021/01/04 | [
"https://Stackoverflow.com/questions/65556345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9604850/"
] | ```js
// get parent element which is a div and then get all checkboxes
// check if any of them is checked.
function terms_changed(termsCheckBox) {
document.getElementById("submit_button").disabled = !([...termsCheckBox.parentElement.querySelectorAll("input[type=checkbox]")].some(cb => cb.checked));
}
```
```html
<fo... | If there's a slight chance to reformat HTML, you could apply this functionality only with CSS. Hence I'll post my answer since it differs from all the JS solutions offered here:
```css
button {
background-color: #c0c0c0;
color: GrayText;
border: 2px outset ButtonFace;
pointer-events: none;
}
input:checked ~ d... |
65,556,345 | I am trying to integrate google ads to my react native app, so I followed everything from the official docs [https://rnfirebase.io/](https://rnfirebase.io/admob/usage) and I managed to display google ads.
but when it comes to European User Consent I cant display the Google-rendered consent because the result of the met... | 2021/01/04 | [
"https://Stackoverflow.com/questions/65556345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9604850/"
] | ```js
// get parent element which is a div and then get all checkboxes
// check if any of them is checked.
function terms_changed(termsCheckBox) {
document.getElementById("submit_button").disabled = !([...termsCheckBox.parentElement.querySelectorAll("input[type=checkbox]")].some(cb => cb.checked));
}
```
```html
<fo... | With a bit of reactive programming fun:
* Each `click(...)` return a stream that emits a boolean after each click. True if the checkbox is checked, false otherwise. Starts with false.
* Combine all streams into one. It emits the status of all checkboxes every time one changes.
* Disable button if all checkboxes are un... |
65,556,345 | I am trying to integrate google ads to my react native app, so I followed everything from the official docs [https://rnfirebase.io/](https://rnfirebase.io/admob/usage) and I managed to display google ads.
but when it comes to European User Consent I cant display the Google-rendered consent because the result of the met... | 2021/01/04 | [
"https://Stackoverflow.com/questions/65556345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9604850/"
] | Made some minor changes to the HTML, the attribute values should be in quotes, for example: `id="cb1"`
You can avoid using an onclick attribute on every checkbox by using event delegation that checks the whole form on any click. This can be streamlined to check more specifically, perhaps using `[name="uuid[]"]`
```js... | If there's a slight chance to reformat HTML, you could apply this functionality only with CSS. Hence I'll post my answer since it differs from all the JS solutions offered here:
```css
button {
background-color: #c0c0c0;
color: GrayText;
border: 2px outset ButtonFace;
pointer-events: none;
}
input:checked ~ d... |
65,556,345 | I am trying to integrate google ads to my react native app, so I followed everything from the official docs [https://rnfirebase.io/](https://rnfirebase.io/admob/usage) and I managed to display google ads.
but when it comes to European User Consent I cant display the Google-rendered consent because the result of the met... | 2021/01/04 | [
"https://Stackoverflow.com/questions/65556345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9604850/"
] | Made some minor changes to the HTML, the attribute values should be in quotes, for example: `id="cb1"`
You can avoid using an onclick attribute on every checkbox by using event delegation that checks the whole form on any click. This can be streamlined to check more specifically, perhaps using `[name="uuid[]"]`
```js... | With a bit of reactive programming fun:
* Each `click(...)` return a stream that emits a boolean after each click. True if the checkbox is checked, false otherwise. Starts with false.
* Combine all streams into one. It emits the status of all checkboxes every time one changes.
* Disable button if all checkboxes are un... |
65,556,345 | I am trying to integrate google ads to my react native app, so I followed everything from the official docs [https://rnfirebase.io/](https://rnfirebase.io/admob/usage) and I managed to display google ads.
but when it comes to European User Consent I cant display the Google-rendered consent because the result of the met... | 2021/01/04 | [
"https://Stackoverflow.com/questions/65556345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9604850/"
] | If there's a slight chance to reformat HTML, you could apply this functionality only with CSS. Hence I'll post my answer since it differs from all the JS solutions offered here:
```css
button {
background-color: #c0c0c0;
color: GrayText;
border: 2px outset ButtonFace;
pointer-events: none;
}
input:checked ~ d... | With a bit of reactive programming fun:
* Each `click(...)` return a stream that emits a boolean after each click. True if the checkbox is checked, false otherwise. Starts with false.
* Combine all streams into one. It emits the status of all checkboxes every time one changes.
* Disable button if all checkboxes are un... |
13,958,776 | I am trying to add markers according to events in a database and in the case of an event happening at the same location, adding a tab to the infoBubble for that new event. I can't seem to figure out why markers (and my infoBubbles) are not showing up on my map.
**Here is my code:**
```
<script type="text/javascript" ... | 2012/12/19 | [
"https://Stackoverflow.com/questions/13958776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1861431/"
] | There are different issues, most of all the `for (var x = 0; x < markersArray.length; x++)`
You create the markers inside this loop, but initially markersArray is empty, you will never run this loop. There is also a typo, `infobubbleArray` should be `infobubble**s**Array`
Fixed code:
```
downloadUrl("../site_parts/... | I found a solution that seems to be working (besides the tabs starting in a row above the current tabs) here is the ending loop to check for that:
```
var x = 0;
while (x < (markersArray.length)){
if (markersArray[x].getPosition().toString() == point.toString()){
infobubblesArray[x].addTab(date, html);
continue... |
2,417,553 | I have an order form with about 30 text fields that contain numerical values. I'd like to calculate the sum of all those values on blur.
I know how to select all text fields but not how to loop through them and add up all their values?
```
$(document).ready(function(){
$(".price").blur(function() {
//loop and ... | 2010/03/10 | [
"https://Stackoverflow.com/questions/2417553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] | Similarly along the lines of these answers written as a plugin:
```
$.fn.sum = function () {
var sum = 0;
this.each(function () {
sum += 1*($(this).val());
});
return sum;
};
```
For the record 1 \* x is faster than Number(x) in Chrome | ```
$(".price").each(function(){
total_price += parseFloat($(this).val());
});
```
please try like this... |
2,417,553 | I have an order form with about 30 text fields that contain numerical values. I'd like to calculate the sum of all those values on blur.
I know how to select all text fields but not how to loop through them and add up all their values?
```
$(document).ready(function(){
$(".price").blur(function() {
//loop and ... | 2010/03/10 | [
"https://Stackoverflow.com/questions/2417553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] |
```
$('.price').blur(function () {
var sum = 0;
$('.price').each(function() {
sum += Number($(this).val());
});
// here, you have your sum
});
``` | ```
$('.price').blur(function () {
var sum = 0;
$('.price').each(function() {
if($(this).val()!="")
{
sum += parseFloat($(this).val());
}
});
alert(sum);
});
```
**[JS Fiddle](http://jsfiddle.net/avarm26a/1/)** |
2,417,553 | I have an order form with about 30 text fields that contain numerical values. I'd like to calculate the sum of all those values on blur.
I know how to select all text fields but not how to loop through them and add up all their values?
```
$(document).ready(function(){
$(".price").blur(function() {
//loop and ... | 2010/03/10 | [
"https://Stackoverflow.com/questions/2417553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] |
```
$('.price').blur(function () {
var sum = 0;
$('.price').each(function() {
sum += Number($(this).val());
});
// here, you have your sum
});
``` | ```
$(".price").each(function(){
total_price += parseFloat($(this).val());
});
```
please try like this... |
2,417,553 | I have an order form with about 30 text fields that contain numerical values. I'd like to calculate the sum of all those values on blur.
I know how to select all text fields but not how to loop through them and add up all their values?
```
$(document).ready(function(){
$(".price").blur(function() {
//loop and ... | 2010/03/10 | [
"https://Stackoverflow.com/questions/2417553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] | If you don't need to support IE8 then you can use the native Javascript `Array.prototype.reduce()` method. You will need to convert your JQuery object into an array first:
```
var sum = $('.price').toArray().reduce(function(sum,element) {
if(isNaN(sum)) sum = 0;
return sum + Number(element.value);
}, 0);
... | This will work 100%:
```js
<script type="text/javascript">
function calculate() {
var result = document.getElementById('result');
var el, i = 0, total = 0;
while(el = document.getElementById('v'+(i++)) ) {
el.value = el.value.replace(/\\D/,"");
total = total + Number(el.value);
}
r... |
2,417,553 | I have an order form with about 30 text fields that contain numerical values. I'd like to calculate the sum of all those values on blur.
I know how to select all text fields but not how to loop through them and add up all their values?
```
$(document).ready(function(){
$(".price").blur(function() {
//loop and ... | 2010/03/10 | [
"https://Stackoverflow.com/questions/2417553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] | A tad more generic copy/paste function for your project.
```
sumjq = function(selector) {
var sum = 0;
$(selector).each(function() {
sum += Number($(this).text());
});
return sum;
}
console.log(sumjq('.price'));
``` | This should fix it:
```
var total = 0;
$(".price").each( function(){
total += $(this).val() * 1;
});
``` |
2,417,553 | I have an order form with about 30 text fields that contain numerical values. I'd like to calculate the sum of all those values on blur.
I know how to select all text fields but not how to loop through them and add up all their values?
```
$(document).ready(function(){
$(".price").blur(function() {
//loop and ... | 2010/03/10 | [
"https://Stackoverflow.com/questions/2417553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] |
```
$('.price').blur(function () {
var sum = 0;
$('.price').each(function() {
sum += Number($(this).val());
});
// here, you have your sum
});
``` | If you don't need to support IE8 then you can use the native Javascript `Array.prototype.reduce()` method. You will need to convert your JQuery object into an array first:
```
var sum = $('.price').toArray().reduce(function(sum,element) {
if(isNaN(sum)) sum = 0;
return sum + Number(element.value);
}, 0);
... |
2,417,553 | I have an order form with about 30 text fields that contain numerical values. I'd like to calculate the sum of all those values on blur.
I know how to select all text fields but not how to loop through them and add up all their values?
```
$(document).ready(function(){
$(".price").blur(function() {
//loop and ... | 2010/03/10 | [
"https://Stackoverflow.com/questions/2417553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] | If you don't need to support IE8 then you can use the native Javascript `Array.prototype.reduce()` method. You will need to convert your JQuery object into an array first:
```
var sum = $('.price').toArray().reduce(function(sum,element) {
if(isNaN(sum)) sum = 0;
return sum + Number(element.value);
}, 0);
... | ```
$(".price").each(function(){
total_price += parseFloat($(this).val());
});
```
please try like this... |
2,417,553 | I have an order form with about 30 text fields that contain numerical values. I'd like to calculate the sum of all those values on blur.
I know how to select all text fields but not how to loop through them and add up all their values?
```
$(document).ready(function(){
$(".price").blur(function() {
//loop and ... | 2010/03/10 | [
"https://Stackoverflow.com/questions/2417553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] |
```
$('.price').blur(function () {
var sum = 0;
$('.price').each(function() {
sum += Number($(this).val());
});
// here, you have your sum
});
``` | Use this function:
```
$(".price").each(function(){
total_price += parseInt($(this).val());
});
``` |
2,417,553 | I have an order form with about 30 text fields that contain numerical values. I'd like to calculate the sum of all those values on blur.
I know how to select all text fields but not how to loop through them and add up all their values?
```
$(document).ready(function(){
$(".price").blur(function() {
//loop and ... | 2010/03/10 | [
"https://Stackoverflow.com/questions/2417553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] | If you don't need to support IE8 then you can use the native Javascript `Array.prototype.reduce()` method. You will need to convert your JQuery object into an array first:
```
var sum = $('.price').toArray().reduce(function(sum,element) {
if(isNaN(sum)) sum = 0;
return sum + Number(element.value);
}, 0);
... | Similarly along the lines of these answers written as a plugin:
```
$.fn.sum = function () {
var sum = 0;
this.each(function () {
sum += 1*($(this).val());
});
return sum;
};
```
For the record 1 \* x is faster than Number(x) in Chrome |
2,417,553 | I have an order form with about 30 text fields that contain numerical values. I'd like to calculate the sum of all those values on blur.
I know how to select all text fields but not how to loop through them and add up all their values?
```
$(document).ready(function(){
$(".price").blur(function() {
//loop and ... | 2010/03/10 | [
"https://Stackoverflow.com/questions/2417553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149664/"
] |
```
$('.price').blur(function () {
var sum = 0;
$('.price').each(function() {
sum += Number($(this).val());
});
// here, you have your sum
});
``` | This should fix it:
```
var total = 0;
$(".price").each( function(){
total += $(this).val() * 1;
});
``` |
4,631,887 | yes another problem with this scroll bar
alright so I started the website over again that was mentioned [here](https://stackoverflow.com/questions/4590658/html-css-website-showing-a-scroll-bar-which-doesnt-go-anywhere)
and I am having problems with this scroll bar again
alright so all I have is a single image in a d... | 2011/01/08 | [
"https://Stackoverflow.com/questions/4631887",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I may not be understanding your question, but it looks like your problem is that you've disabled scrolling in the `body` but would like the `div` to scroll. @lukiffer's answer is right. When you resize your browser, however, the scrolling `div`, which is a fixed size, isn't overflowing because its content still fits.
... | ```
div#SuggestionBox { overflow:scroll; }
``` |
15,149,307 | I am trying to work on my gallery, and I need to install rmagick. However I have been unable to do so as I am getting a error with a fail to build gem native extension. I have see the other postings but their errors are different from mines.
I am not sure how to get it to work. If someone knows a fix that would be of ... | 2013/03/01 | [
"https://Stackoverflow.com/questions/15149307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1293260/"
] | It looks like you're missing a shared library called `libltdl` which is required for building the gem. A quick Google search shows that this is provided by the [libtool package](https://www.gnu.org/software/libtool/manual/html_node/Using-libltdl.html).
1. Try installing libtool and see if that fixes the problem. If yo... | The missing library is provided by `libtool` package. You can install via brew:
>
> brew instal libtool
>
>
>
After the installation you get this message:
>
> Xcode 4.2 and below provide glibtool.
>
>
> Generally there are no consequences of this for you. If you build your
> own software and it requires thi... |
15,149,307 | I am trying to work on my gallery, and I need to install rmagick. However I have been unable to do so as I am getting a error with a fail to build gem native extension. I have see the other postings but their errors are different from mines.
I am not sure how to get it to work. If someone knows a fix that would be of ... | 2013/03/01 | [
"https://Stackoverflow.com/questions/15149307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1293260/"
] | To fix this I had to uninstall then reinstall RVM. Then run 'brew install ruby' to get the latest version. Then 'bundle'.
I hope this helps others who ran into the exact error I did. | The missing library is provided by `libtool` package. You can install via brew:
>
> brew instal libtool
>
>
>
After the installation you get this message:
>
> Xcode 4.2 and below provide glibtool.
>
>
> Generally there are no consequences of this for you. If you build your
> own software and it requires thi... |
622,926 | Not exactly sure what kind of AC or DC motor would be needed to make this. Is it even a realistic idea to make electricity by using a motor as a generator?
<https://www.youtube.com/watch?v=V3NtSp6aAbs> | 2022/06/10 | [
"https://electronics.stackexchange.com/questions/622926",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/285877/"
] | The actual video pins on a VGA connector are red, green, blue, horizontal sync, and vertical sync (there are some digital monitor ID pins, but they don't matter here). Sync is pulses (per line and per field) and RGB are simply analog voltage levels, 0 for black through 0.7V for full intensity. There's no bits being mod... | >
> If VGA (video graphics array) is analog, then how is it compatible with a digital monitor?
>
>
>
It's not "compatible" by any meaning of the word. (I'd even say: a signal is never compatible with a device; a device might be able to deal with a signal). The digital monitor has an sampling input converter (an *A... |
622,926 | Not exactly sure what kind of AC or DC motor would be needed to make this. Is it even a realistic idea to make electricity by using a motor as a generator?
<https://www.youtube.com/watch?v=V3NtSp6aAbs> | 2022/06/10 | [
"https://electronics.stackexchange.com/questions/622926",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/285877/"
] | VGA signals are analog RGB. They can be digitized in the monitor and processed digitally, then presented to the display, or used directly on a CRT.
What monitors digitize the signal?
* Later-generation CRT television sets digitize the composite signal and process it into RGB for the display. If they also support RGB ... | >
> If VGA (video graphics array) is analog, then how is it compatible with a digital monitor?
>
>
>
It's not "compatible" by any meaning of the word. (I'd even say: a signal is never compatible with a device; a device might be able to deal with a signal). The digital monitor has an sampling input converter (an *A... |
71,032,428 | I generated some options using shell script, `echo $NLB_EIPS` resulting in `-p "route 1.1.1.1 255.255.255.255" -p "route 2.2.2.2 255.255.255.255" -p "route 3.3.3.3 255.255.255.255"`
I need to append this option to my original command of `docker run <SOME_OTHER_OPTIONS...> -p "route 192.0.0.0 255.255.0.0" -p "route 10.... | 2022/02/08 | [
"https://Stackoverflow.com/questions/71032428",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10690874/"
] | Your example is not reproducible because we can't construct the query but I suppose, this should work:
```
import pandas as pd
df = pd.DataFrame(list(query.rows()))
# OR
df = pd.DataFrame(query.rows(), columns=query.views)
```
Output:
```
>>> df
Gene.briefDescription Gene.desc... | Pandas would help you.<https://pandas.pydata.org>. Feel free to ask questions if you stuck with something. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.