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
32,667,026
I have a problem with resume Activity. I have a MainActivity which contains other activities. Each one contains a radio station. I have a button (Play) in each activity, and when the user clicks on it, the button changes its function to Stop, so it turns to Stop button. My problem is that when I go for example from Act...
2015/09/19
[ "https://Stackoverflow.com/questions/32667026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3456108/" ]
I wouldn't do this on the *REST API level*, I'd do it on the *model level*, because then the +1 increase will always happen, regardless of where it happened (not only when you hit a particular REST view/serializer) Django signals -------------- > > Everytime I add a new Reader to the database I want to increase numb...
It depends on the design of your app and particularly on where you will reuse this logic. For example, if you want the same logic for adding `Reader`s everywhere in your app, do it in a signal, as bakkal suggests or in `save`. If it depends on the API endpoint, you might want to do it in a view. It will also depend ...
13,275,446
I am using PayPal Adaptive payments (chained payments). If I set: 1. CREATE payment 2. In the SetPaymentOptions -> Requires shipping address selection = true 3. When I redirect user for the https://www.sandbox.paypal.com/webscr&cmd=\_ap-payment&paykey=[PA KEY] user after authentication is not shown any prompt for ship...
2012/11/07
[ "https://Stackoverflow.com/questions/13275446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/665967/" ]
You can try [COMPUTE](http://msdn.microsoft.com/en-us/library/ms181708%28v=sql.105%29.aspx) ``` Select ID, OrderID, Item, Price from customerOrders Where Order = 1 COMPUTE SUM(Price) ```
This is what you need: ``` Select ID, OrderID, Item, Price from customerOrders Where Order = 1 Union Select NULL, NULL, NULL, ( Select Sum(Price) from customerOrders Where Order = 1 Group By Order ) ``` **UPDATE** Incase the result was empty, the total should be zero, not empty. Use t...
13,275,446
I am using PayPal Adaptive payments (chained payments). If I set: 1. CREATE payment 2. In the SetPaymentOptions -> Requires shipping address selection = true 3. When I redirect user for the https://www.sandbox.paypal.com/webscr&cmd=\_ap-payment&paykey=[PA KEY] user after authentication is not shown any prompt for ship...
2012/11/07
[ "https://Stackoverflow.com/questions/13275446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/665967/" ]
Two steps: 1, To generate the SUM, you need to add it to the result set using UNION ALL. UNION adds a DISTINCT operation which isn't required, even if in your case it won't change the result. ``` Select ID, OrderID, Item, Price from customerOrders Where [Order] = 1 UNION ALL Select NULL, NULL, NULL, SUM(Price) from c...
This is what you need: ``` Select ID, OrderID, Item, Price from customerOrders Where Order = 1 Union Select NULL, NULL, NULL, ( Select Sum(Price) from customerOrders Where Order = 1 Group By Order ) ``` **UPDATE** Incase the result was empty, the total should be zero, not empty. Use t...
13,275,446
I am using PayPal Adaptive payments (chained payments). If I set: 1. CREATE payment 2. In the SetPaymentOptions -> Requires shipping address selection = true 3. When I redirect user for the https://www.sandbox.paypal.com/webscr&cmd=\_ap-payment&paykey=[PA KEY] user after authentication is not shown any prompt for ship...
2012/11/07
[ "https://Stackoverflow.com/questions/13275446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/665967/" ]
Technically, the thing you want is called a roll-up row. SQL Server has a special function for such cases, it's called `ROLLUP()` and used inside a `GROUP BY` clause. In your particular situation, the query would basically look like this: ``` SELECT ID, OrderID, Item, SUM(Price) AS Price FROM customerOrders WHERE Orde...
This is what you need: ``` Select ID, OrderID, Item, Price from customerOrders Where Order = 1 Union Select NULL, NULL, NULL, ( Select Sum(Price) from customerOrders Where Order = 1 Group By Order ) ``` **UPDATE** Incase the result was empty, the total should be zero, not empty. Use t...
13,275,446
I am using PayPal Adaptive payments (chained payments). If I set: 1. CREATE payment 2. In the SetPaymentOptions -> Requires shipping address selection = true 3. When I redirect user for the https://www.sandbox.paypal.com/webscr&cmd=\_ap-payment&paykey=[PA KEY] user after authentication is not shown any prompt for ship...
2012/11/07
[ "https://Stackoverflow.com/questions/13275446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/665967/" ]
Two steps: 1, To generate the SUM, you need to add it to the result set using UNION ALL. UNION adds a DISTINCT operation which isn't required, even if in your case it won't change the result. ``` Select ID, OrderID, Item, Price from customerOrders Where [Order] = 1 UNION ALL Select NULL, NULL, NULL, SUM(Price) from c...
You can try [COMPUTE](http://msdn.microsoft.com/en-us/library/ms181708%28v=sql.105%29.aspx) ``` Select ID, OrderID, Item, Price from customerOrders Where Order = 1 COMPUTE SUM(Price) ```
13,275,446
I am using PayPal Adaptive payments (chained payments). If I set: 1. CREATE payment 2. In the SetPaymentOptions -> Requires shipping address selection = true 3. When I redirect user for the https://www.sandbox.paypal.com/webscr&cmd=\_ap-payment&paykey=[PA KEY] user after authentication is not shown any prompt for ship...
2012/11/07
[ "https://Stackoverflow.com/questions/13275446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/665967/" ]
Two steps: 1, To generate the SUM, you need to add it to the result set using UNION ALL. UNION adds a DISTINCT operation which isn't required, even if in your case it won't change the result. ``` Select ID, OrderID, Item, Price from customerOrders Where [Order] = 1 UNION ALL Select NULL, NULL, NULL, SUM(Price) from c...
Technically, the thing you want is called a roll-up row. SQL Server has a special function for such cases, it's called `ROLLUP()` and used inside a `GROUP BY` clause. In your particular situation, the query would basically look like this: ``` SELECT ID, OrderID, Item, SUM(Price) AS Price FROM customerOrders WHERE Orde...
54,865,524
I have recently finished building my website and since I didn't know how to put it online I decided to follow this tutorial: <https://youtu.be/tq7dqdHCc7U> Everything worked fine until I tried to upload my .html files. I copied them into a www folder I created, but when I try to access the site with myIP/~username, I g...
2019/02/25
[ "https://Stackoverflow.com/questions/54865524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11037218/" ]
My approach would be the following, extract the leading digits of both arrays and compare those: ``` a=num2str(A)-'0'; b=num2str(B)-'0'; [ida,idb]=ismember(a(:,1),b(:,1)); ``` Now get the sorting index of `A` ``` [~,ids]=sort(a(:,1)); ``` Create output array ``` C=zeros(size(A,1),2); ``` Finally assi...
First of all, the whole script. At first glance, I couldn't find a solution without using loops. ``` A = [ 12345; 47542; 32673; 65436; 75343; 23496; 54765; ] B = [ 23566; 33425; 65438; 75354; ] A = sort(A); % Sort A and B. B = sort(B)...
54,865,524
I have recently finished building my website and since I didn't know how to put it online I decided to follow this tutorial: <https://youtu.be/tq7dqdHCc7U> Everything worked fine until I tried to upload my .html files. I copied them into a www folder I created, but when I try to access the site with myIP/~username, I g...
2019/02/25
[ "https://Stackoverflow.com/questions/54865524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11037218/" ]
If it's only the first digit, we only need to check if the first digit (i.e. `floor(A/1e4)`) matches `0` to `9`, and index accordingly... ``` % Add some zeros at the front to make indexing work with the unmatched ismember outputs Az = [zero(; A]; Bz = [0; B]; % Find the indices for 0 to 9 within the first digits of ...
First of all, the whole script. At first glance, I couldn't find a solution without using loops. ``` A = [ 12345; 47542; 32673; 65436; 75343; 23496; 54765; ] B = [ 23566; 33425; 65438; 75354; ] A = sort(A); % Sort A and B. B = sort(B)...
3,306,470
* Check that the set $\mathbb{R}^\omega$ of all infinite-tuples of real numbers $$x=(x\_1,x\_2,...)$$ is a vector space under component-wise addition and scalar multiplication. My Attempt. Let $x,y\in\mathbb{R}^\omega$. We need to show: 1) $x+y=(x\_1,x\_2,...)+(y\_1,y\_2,...)=(x\_1+y\_1,x\_2+y\_2,...)\in\mathbb{R}^...
2019/07/28
[ "https://math.stackexchange.com/questions/3306470", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Hint : One of the numbers $x-1,x,x+1$ must be divisible by $3$
Try re-writing $ x^2-1 $ using the difference of two squares: $$ x^2 - 1 = (x+1)(x-1)$$ If we know that this is a multiple of 3, then what can you say about $x+1$ and $x-1$?
3,306,470
* Check that the set $\mathbb{R}^\omega$ of all infinite-tuples of real numbers $$x=(x\_1,x\_2,...)$$ is a vector space under component-wise addition and scalar multiplication. My Attempt. Let $x,y\in\mathbb{R}^\omega$. We need to show: 1) $x+y=(x\_1,x\_2,...)+(y\_1,y\_2,...)=(x\_1+y\_1,x\_2+y\_2,...)\in\mathbb{R}^...
2019/07/28
[ "https://math.stackexchange.com/questions/3306470", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Hint : One of the numbers $x-1,x,x+1$ must be divisible by $3$
**Hint:** The sequence of $(n^2-1)\bmod 3$ is $2,0,0,2,0,0,2,0,0,\cdots$
3,306,470
* Check that the set $\mathbb{R}^\omega$ of all infinite-tuples of real numbers $$x=(x\_1,x\_2,...)$$ is a vector space under component-wise addition and scalar multiplication. My Attempt. Let $x,y\in\mathbb{R}^\omega$. We need to show: 1) $x+y=(x\_1,x\_2,...)+(y\_1,y\_2,...)=(x\_1+y\_1,x\_2+y\_2,...)\in\mathbb{R}^...
2019/07/28
[ "https://math.stackexchange.com/questions/3306470", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Hint : One of the numbers $x-1,x,x+1$ must be divisible by $3$
$\Leftarrow:$ Assume $3|(x^2-1)$; Then $3|(x-1)(x+1)$; Euclid's lemma: $3|(x-1)$ or $3|(x+1)$, hence $3 \not | x$; $\Rightarrow:$ Assume $3\not | x$; We have $3| (x-1)(x)(x+1)$, three consecutive integers. Euclid's lemma: $3|(x-1)$ or $3|(x+1)$, hence $3|(x-1)(x+1)$, and we are done.
3,306,470
* Check that the set $\mathbb{R}^\omega$ of all infinite-tuples of real numbers $$x=(x\_1,x\_2,...)$$ is a vector space under component-wise addition and scalar multiplication. My Attempt. Let $x,y\in\mathbb{R}^\omega$. We need to show: 1) $x+y=(x\_1,x\_2,...)+(y\_1,y\_2,...)=(x\_1+y\_1,x\_2+y\_2,...)\in\mathbb{R}^...
2019/07/28
[ "https://math.stackexchange.com/questions/3306470", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Hint : One of the numbers $x-1,x,x+1$ must be divisible by $3$
Use *congruences*: A number $x$ is divisible by $3$ iff $x\equiv 0\bmod 3$. A number $x$ is *not* divisible by $3$ iff $x\equiv 1$ or $-1\bmod 3$, and in this single case, $x^2\equiv 1\bmod 3$.
3,306,470
* Check that the set $\mathbb{R}^\omega$ of all infinite-tuples of real numbers $$x=(x\_1,x\_2,...)$$ is a vector space under component-wise addition and scalar multiplication. My Attempt. Let $x,y\in\mathbb{R}^\omega$. We need to show: 1) $x+y=(x\_1,x\_2,...)+(y\_1,y\_2,...)=(x\_1+y\_1,x\_2+y\_2,...)\in\mathbb{R}^...
2019/07/28
[ "https://math.stackexchange.com/questions/3306470", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Try re-writing $ x^2-1 $ using the difference of two squares: $$ x^2 - 1 = (x+1)(x-1)$$ If we know that this is a multiple of 3, then what can you say about $x+1$ and $x-1$?
$\Leftarrow:$ Assume $3|(x^2-1)$; Then $3|(x-1)(x+1)$; Euclid's lemma: $3|(x-1)$ or $3|(x+1)$, hence $3 \not | x$; $\Rightarrow:$ Assume $3\not | x$; We have $3| (x-1)(x)(x+1)$, three consecutive integers. Euclid's lemma: $3|(x-1)$ or $3|(x+1)$, hence $3|(x-1)(x+1)$, and we are done.
3,306,470
* Check that the set $\mathbb{R}^\omega$ of all infinite-tuples of real numbers $$x=(x\_1,x\_2,...)$$ is a vector space under component-wise addition and scalar multiplication. My Attempt. Let $x,y\in\mathbb{R}^\omega$. We need to show: 1) $x+y=(x\_1,x\_2,...)+(y\_1,y\_2,...)=(x\_1+y\_1,x\_2+y\_2,...)\in\mathbb{R}^...
2019/07/28
[ "https://math.stackexchange.com/questions/3306470", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Try re-writing $ x^2-1 $ using the difference of two squares: $$ x^2 - 1 = (x+1)(x-1)$$ If we know that this is a multiple of 3, then what can you say about $x+1$ and $x-1$?
Use *congruences*: A number $x$ is divisible by $3$ iff $x\equiv 0\bmod 3$. A number $x$ is *not* divisible by $3$ iff $x\equiv 1$ or $-1\bmod 3$, and in this single case, $x^2\equiv 1\bmod 3$.
3,306,470
* Check that the set $\mathbb{R}^\omega$ of all infinite-tuples of real numbers $$x=(x\_1,x\_2,...)$$ is a vector space under component-wise addition and scalar multiplication. My Attempt. Let $x,y\in\mathbb{R}^\omega$. We need to show: 1) $x+y=(x\_1,x\_2,...)+(y\_1,y\_2,...)=(x\_1+y\_1,x\_2+y\_2,...)\in\mathbb{R}^...
2019/07/28
[ "https://math.stackexchange.com/questions/3306470", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
**Hint:** The sequence of $(n^2-1)\bmod 3$ is $2,0,0,2,0,0,2,0,0,\cdots$
$\Leftarrow:$ Assume $3|(x^2-1)$; Then $3|(x-1)(x+1)$; Euclid's lemma: $3|(x-1)$ or $3|(x+1)$, hence $3 \not | x$; $\Rightarrow:$ Assume $3\not | x$; We have $3| (x-1)(x)(x+1)$, three consecutive integers. Euclid's lemma: $3|(x-1)$ or $3|(x+1)$, hence $3|(x-1)(x+1)$, and we are done.
3,306,470
* Check that the set $\mathbb{R}^\omega$ of all infinite-tuples of real numbers $$x=(x\_1,x\_2,...)$$ is a vector space under component-wise addition and scalar multiplication. My Attempt. Let $x,y\in\mathbb{R}^\omega$. We need to show: 1) $x+y=(x\_1,x\_2,...)+(y\_1,y\_2,...)=(x\_1+y\_1,x\_2+y\_2,...)\in\mathbb{R}^...
2019/07/28
[ "https://math.stackexchange.com/questions/3306470", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
**Hint:** The sequence of $(n^2-1)\bmod 3$ is $2,0,0,2,0,0,2,0,0,\cdots$
Use *congruences*: A number $x$ is divisible by $3$ iff $x\equiv 0\bmod 3$. A number $x$ is *not* divisible by $3$ iff $x\equiv 1$ or $-1\bmod 3$, and in this single case, $x^2\equiv 1\bmod 3$.
7,744,272
I'm dealing with the WPF DataGrid. I need it to show the empty row for new items when I start editing a new row. I want this because sometimes the user just clicks outside of the datagrid without completing the information of the row. A solution I tried was commiting row changes when the grid lost focus BUT the event ...
2011/10/12
[ "https://Stackoverflow.com/questions/7744272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543712/" ]
I hope the below code will help. ``` private void grdEmp_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e) { if (!isManualEditCommit) { isManualEditCommit = true; DataGrid grid = (DataGrid)sender; grid.CommitEdit(DataGridEditingUnit.Row, true); ...
You might take a look at [this answer](https://stackoverflow.com/questions/3354916/what-is-the-proper-way-to-handle-multiple-datagrids-in-a-tab-control-so-that-cell/6467171#6467171). The specifics are different, but basically, it sets up a behavior to commit changes when the DataGrid loses focus. I was able to tweak th...
39,390,337
I use HTTP provider in Angular 2 for data loading from API. ``` return this.http.post(url, urlSearchParams.toString(), { headers: this.getHttpHeaders() }) .retryWhen((error) => { return this.handleRetryError(error); }) ``` When there is no or old session I create new one in this.handleRet...
2016/09/08
[ "https://Stackoverflow.com/questions/39390337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2949885/" ]
You need to wrap the Observable and retry the resulting outer Observable so each time it executes again. ``` Observable.of(1).mergeMap(x=> { return this.http.get('data.json', this.configObject()) .do(x => throw(x)) .map(res=>res.json()); }) .retryWhen(e => e.delay(2000)) .subscribe(); ``` for your code ``` re...
Try this: ``` return Observable .defer(() => { this.http.post(url, urlSearchParams.toString(), { headers: this.getHttpHeaders() }); }) .retryWhen(errors => { this.handleRetryError(errors); return errors.delay(200) }); ```
39,390,337
I use HTTP provider in Angular 2 for data loading from API. ``` return this.http.post(url, urlSearchParams.toString(), { headers: this.getHttpHeaders() }) .retryWhen((error) => { return this.handleRetryError(error); }) ``` When there is no or old session I create new one in this.handleRet...
2016/09/08
[ "https://Stackoverflow.com/questions/39390337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2949885/" ]
You need to wrap the Observable and retry the resulting outer Observable so each time it executes again. ``` Observable.of(1).mergeMap(x=> { return this.http.get('data.json', this.configObject()) .do(x => throw(x)) .map(res=>res.json()); }) .retryWhen(e => e.delay(2000)) .subscribe(); ``` for your code ``` re...
You could possibly keep a reference to a headers variable outside that function, and then modify that variable inside the retryWhen function. ``` let headers = this.getHttpHeaders(); return this.http.post(url, urlSearchParams.toString(), { headers: headers }) .retryWhen((error) => { headers.foo = "bar"; ...
106,872
Plugging in numbers shows me that it is the same, but I don't know how to get from one to the other. I get stuck at: $$ n!(n+1) = n n! + n! $$ I can't make the connection for the final step. $(2n + n)!$ doesn't seem right, cause then i would just take n out again and be left with $n!$ $(n+1)$ which is the same thin...
2012/02/07
[ "https://math.stackexchange.com/questions/106872", "https://math.stackexchange.com", "https://math.stackexchange.com/users/21871/" ]
It's almost transparent. $ n!=n(n-1)(n-2)\cdots2\cdot1$ and $(n+1)!=(n+1)n(n-1) \cdots2\cdot1$. You should be able to see it from the above. Or you can argue as follows: $$\eqalign{ \color{maroon}{n!}(n+1)&=[\color{maroon}{n(n-1)(n-2)\cdots2\cdot1 }](n+1)\cr &= (n+1)[\color{maroon}{n(n-1)(n-2)\cdots2\cdot1 }]\cr &=...
Use the definition of factorial. And show the left equals the right rather than the right equals the left.
106,872
Plugging in numbers shows me that it is the same, but I don't know how to get from one to the other. I get stuck at: $$ n!(n+1) = n n! + n! $$ I can't make the connection for the final step. $(2n + n)!$ doesn't seem right, cause then i would just take n out again and be left with $n!$ $(n+1)$ which is the same thin...
2012/02/07
[ "https://math.stackexchange.com/questions/106872", "https://math.stackexchange.com", "https://math.stackexchange.com/users/21871/" ]
It's almost transparent. $ n!=n(n-1)(n-2)\cdots2\cdot1$ and $(n+1)!=(n+1)n(n-1) \cdots2\cdot1$. You should be able to see it from the above. Or you can argue as follows: $$\eqalign{ \color{maroon}{n!}(n+1)&=[\color{maroon}{n(n-1)(n-2)\cdots2\cdot1 }](n+1)\cr &= (n+1)[\color{maroon}{n(n-1)(n-2)\cdots2\cdot1 }]\cr &=...
We could use a combinatorial argument to prove that: $n!(n+1) = (n+1)!$ This may not be what the PO wants, nevertheless, I found it interesting! is to construct 2 scenarios for generating permutation. **Scenario 1** takes (n+1) objects to permute. The number of permutation is $(n+1)!$ by definition. This covers th...
106,872
Plugging in numbers shows me that it is the same, but I don't know how to get from one to the other. I get stuck at: $$ n!(n+1) = n n! + n! $$ I can't make the connection for the final step. $(2n + n)!$ doesn't seem right, cause then i would just take n out again and be left with $n!$ $(n+1)$ which is the same thin...
2012/02/07
[ "https://math.stackexchange.com/questions/106872", "https://math.stackexchange.com", "https://math.stackexchange.com/users/21871/" ]
It's almost transparent. $ n!=n(n-1)(n-2)\cdots2\cdot1$ and $(n+1)!=(n+1)n(n-1) \cdots2\cdot1$. You should be able to see it from the above. Or you can argue as follows: $$\eqalign{ \color{maroon}{n!}(n+1)&=[\color{maroon}{n(n-1)(n-2)\cdots2\cdot1 }](n+1)\cr &= (n+1)[\color{maroon}{n(n-1)(n-2)\cdots2\cdot1 }]\cr &=...
Yet another way to write out a "proof" would be using [product notation](http://en.wikipedia.org/wiki/Multiplication#Capital_Pi_notation) and the definition $n! = \prod\_{k=1}^n k$: $$(n+1)\,n! = (n+1) \prod\_{k=1}^n k = \prod\_{k=1}^{n+1} k = (n+1)!$$ But of course, as Chris Taylor points out in the comments, the va...
481,330
I received a newsletter from my University that read, "Are you promoting innovation, diversity, and excellence at [university name]?" I was with a friend and we both saw the email on our phones. I quipped "Nope. I'm an agent of mediocrity, exclusion, and ..." but I couldn't think of a good antonym for innovation in th...
2019/01/15
[ "https://english.stackexchange.com/questions/481330", "https://english.stackexchange.com", "https://english.stackexchange.com/users/332141/" ]
I’m eager to scuttle any efforts to advance. In this context the word you may be looking for: backwards. For a sentence like “Nope. I'm a backwards agent of mediocrity and exclusion.”
stat·ic ------- > > adjective lacking in movement, action, or change, especially in a way > viewed as undesirable or uninteresting. (of a process or variable) not > able to be changed during a set period, for example while a program is > running. > > > --- Synonyms > > unchanged fixed stable steady unchangi...
481,330
I received a newsletter from my University that read, "Are you promoting innovation, diversity, and excellence at [university name]?" I was with a friend and we both saw the email on our phones. I quipped "Nope. I'm an agent of mediocrity, exclusion, and ..." but I couldn't think of a good antonym for innovation in th...
2019/01/15
[ "https://english.stackexchange.com/questions/481330", "https://english.stackexchange.com", "https://english.stackexchange.com/users/332141/" ]
The Merriam-Webster definition of [*innovation*](https://www.merriam-webster.com/dictionary/innovation) is: > > 1 : the introduction of something new > > 2 : a new idea, method, or device : NOVELTY > > > So, instead of promoting something *new*, you could be said to be promoting something *the same* as everyth...
stat·ic ------- > > adjective lacking in movement, action, or change, especially in a way > viewed as undesirable or uninteresting. (of a process or variable) not > able to be changed during a set period, for example while a program is > running. > > > --- Synonyms > > unchanged fixed stable steady unchangi...
481,330
I received a newsletter from my University that read, "Are you promoting innovation, diversity, and excellence at [university name]?" I was with a friend and we both saw the email on our phones. I quipped "Nope. I'm an agent of mediocrity, exclusion, and ..." but I couldn't think of a good antonym for innovation in th...
2019/01/15
[ "https://english.stackexchange.com/questions/481330", "https://english.stackexchange.com", "https://english.stackexchange.com/users/332141/" ]
I’m eager to scuttle any efforts to advance. In this context the word you may be looking for: backwards. For a sentence like “Nope. I'm a backwards agent of mediocrity and exclusion.”
At the time, I used **traditionalism** but I felt that could have been improved upon. I thought there might be a more business-specific word that would be a better antonym for innovation. --- > > the upholding or maintenance of tradition, especially so as to resist change. > > >
481,330
I received a newsletter from my University that read, "Are you promoting innovation, diversity, and excellence at [university name]?" I was with a friend and we both saw the email on our phones. I quipped "Nope. I'm an agent of mediocrity, exclusion, and ..." but I couldn't think of a good antonym for innovation in th...
2019/01/15
[ "https://english.stackexchange.com/questions/481330", "https://english.stackexchange.com", "https://english.stackexchange.com/users/332141/" ]
The Merriam-Webster definition of [*innovation*](https://www.merriam-webster.com/dictionary/innovation) is: > > 1 : the introduction of something new > > 2 : a new idea, method, or device : NOVELTY > > > So, instead of promoting something *new*, you could be said to be promoting something *the same* as everyth...
At the time, I used **traditionalism** but I felt that could have been improved upon. I thought there might be a more business-specific word that would be a better antonym for innovation. --- > > the upholding or maintenance of tradition, especially so as to resist change. > > >
481,330
I received a newsletter from my University that read, "Are you promoting innovation, diversity, and excellence at [university name]?" I was with a friend and we both saw the email on our phones. I quipped "Nope. I'm an agent of mediocrity, exclusion, and ..." but I couldn't think of a good antonym for innovation in th...
2019/01/15
[ "https://english.stackexchange.com/questions/481330", "https://english.stackexchange.com", "https://english.stackexchange.com/users/332141/" ]
I’m eager to scuttle any efforts to advance. In this context the word you may be looking for: backwards. For a sentence like “Nope. I'm a backwards agent of mediocrity and exclusion.”
"... the status quo" > > the existing state of affairs > > > [MW](https://www.merriam-webster.com/dictionary/status%20quo) I think it goes with the flow of what you're saying a bit more naturally than the thesaurus answers. > > Nope. I'm an agent of mediocrity, exclusion, and the status quo. > > >
481,330
I received a newsletter from my University that read, "Are you promoting innovation, diversity, and excellence at [university name]?" I was with a friend and we both saw the email on our phones. I quipped "Nope. I'm an agent of mediocrity, exclusion, and ..." but I couldn't think of a good antonym for innovation in th...
2019/01/15
[ "https://english.stackexchange.com/questions/481330", "https://english.stackexchange.com", "https://english.stackexchange.com/users/332141/" ]
The Merriam-Webster definition of [*innovation*](https://www.merriam-webster.com/dictionary/innovation) is: > > 1 : the introduction of something new > > 2 : a new idea, method, or device : NOVELTY > > > So, instead of promoting something *new*, you could be said to be promoting something *the same* as everyth...
"... the status quo" > > the existing state of affairs > > > [MW](https://www.merriam-webster.com/dictionary/status%20quo) I think it goes with the flow of what you're saying a bit more naturally than the thesaurus answers. > > Nope. I'm an agent of mediocrity, exclusion, and the status quo. > > >
481,330
I received a newsletter from my University that read, "Are you promoting innovation, diversity, and excellence at [university name]?" I was with a friend and we both saw the email on our phones. I quipped "Nope. I'm an agent of mediocrity, exclusion, and ..." but I couldn't think of a good antonym for innovation in th...
2019/01/15
[ "https://english.stackexchange.com/questions/481330", "https://english.stackexchange.com", "https://english.stackexchange.com/users/332141/" ]
I’m eager to scuttle any efforts to advance. In this context the word you may be looking for: backwards. For a sentence like “Nope. I'm a backwards agent of mediocrity and exclusion.”
I depends on how badly you want to oppose innovation.  If you just want to dig your feet into the ground and stay where you are, then [stagnation](https://english.stackexchange.com/q/481330/26083#481331 "M. C.’s answer") and [the status quo](https://english.stackexchange.com/q/481330/26083#481339 "jimm101’s answer") ar...
481,330
I received a newsletter from my University that read, "Are you promoting innovation, diversity, and excellence at [university name]?" I was with a friend and we both saw the email on our phones. I quipped "Nope. I'm an agent of mediocrity, exclusion, and ..." but I couldn't think of a good antonym for innovation in th...
2019/01/15
[ "https://english.stackexchange.com/questions/481330", "https://english.stackexchange.com", "https://english.stackexchange.com/users/332141/" ]
I’m eager to scuttle any efforts to advance. In this context the word you may be looking for: backwards. For a sentence like “Nope. I'm a backwards agent of mediocrity and exclusion.”
Consider ***ruination***: > > The action or fact of ruining someone or something or of being ruined. > > *‘commercial malpractice causes the **ruination** of thousands of people’* > > [Oxford *Living* Dictionaries](https://en.oxforddictionaries.com/definition/ruination) > > > It opposes *innovation*, which ...
481,330
I received a newsletter from my University that read, "Are you promoting innovation, diversity, and excellence at [university name]?" I was with a friend and we both saw the email on our phones. I quipped "Nope. I'm an agent of mediocrity, exclusion, and ..." but I couldn't think of a good antonym for innovation in th...
2019/01/15
[ "https://english.stackexchange.com/questions/481330", "https://english.stackexchange.com", "https://english.stackexchange.com/users/332141/" ]
The Merriam-Webster definition of [*innovation*](https://www.merriam-webster.com/dictionary/innovation) is: > > 1 : the introduction of something new > > 2 : a new idea, method, or device : NOVELTY > > > So, instead of promoting something *new*, you could be said to be promoting something *the same* as everyth...
I depends on how badly you want to oppose innovation.  If you just want to dig your feet into the ground and stay where you are, then [stagnation](https://english.stackexchange.com/q/481330/26083#481331 "M. C.’s answer") and [the status quo](https://english.stackexchange.com/q/481330/26083#481339 "jimm101’s answer") ar...
481,330
I received a newsletter from my University that read, "Are you promoting innovation, diversity, and excellence at [university name]?" I was with a friend and we both saw the email on our phones. I quipped "Nope. I'm an agent of mediocrity, exclusion, and ..." but I couldn't think of a good antonym for innovation in th...
2019/01/15
[ "https://english.stackexchange.com/questions/481330", "https://english.stackexchange.com", "https://english.stackexchange.com/users/332141/" ]
The Merriam-Webster definition of [*innovation*](https://www.merriam-webster.com/dictionary/innovation) is: > > 1 : the introduction of something new > > 2 : a new idea, method, or device : NOVELTY > > > So, instead of promoting something *new*, you could be said to be promoting something *the same* as everyth...
Consider ***ruination***: > > The action or fact of ruining someone or something or of being ruined. > > *‘commercial malpractice causes the **ruination** of thousands of people’* > > [Oxford *Living* Dictionaries](https://en.oxforddictionaries.com/definition/ruination) > > > It opposes *innovation*, which ...
394,636
I've created a table that (I think) needs `\makecell{}`, `\multirow{}`, and `multicolumn{}` to be displayed properly. The issue is that the spatial arrangement of my elements is not so great. * The lower and upper subheadings (columns 5 & 6) are not aligned properly. * Columns 1-4 are not placed sensibly (centered or ...
2017/10/05
[ "https://tex.stackexchange.com/questions/394636", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/144938/" ]
Using the [esvect](https://ctan.org/pkg/esvect) package you may just get to what you need ! Try options `[d]` or `[b]` when loading the package. Use command `\vv{arg}` to obtain the arrowed symbols.
I'm afraid not. But you can use the `esvect` package, which has nice arrows tips (8 kinds in all). Furthermore these arrows are extensible, and called with the command `\vv`. If your vector, say e\_r, has an index, use `\vv*{e}{r}`.
394,636
I've created a table that (I think) needs `\makecell{}`, `\multirow{}`, and `multicolumn{}` to be displayed properly. The issue is that the spatial arrangement of my elements is not so great. * The lower and upper subheadings (columns 5 & 6) are not aligned properly. * Columns 1-4 are not placed sensibly (centered or ...
2017/10/05
[ "https://tex.stackexchange.com/questions/394636", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/144938/" ]
Using the [esvect](https://ctan.org/pkg/esvect) package you may just get to what you need ! Try options `[d]` or `[b]` when loading the package. Use command `\vv{arg}` to obtain the arrowed symbols.
You can try manually like this: ``` \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{calc} %opening \title{} \author{} \def\tikzmark#1{\begin{tikzpicture}[remember picture]\node(#1){};\end{tikzpicture}} \makeatletter \renewcommand\vec[1]{\ifdefined\xsh\relax\else\pgf...
394,636
I've created a table that (I think) needs `\makecell{}`, `\multirow{}`, and `multicolumn{}` to be displayed properly. The issue is that the spatial arrangement of my elements is not so great. * The lower and upper subheadings (columns 5 & 6) are not aligned properly. * Columns 1-4 are not placed sensibly (centered or ...
2017/10/05
[ "https://tex.stackexchange.com/questions/394636", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/144938/" ]
I'm afraid not. But you can use the `esvect` package, which has nice arrows tips (8 kinds in all). Furthermore these arrows are extensible, and called with the command `\vv`. If your vector, say e\_r, has an index, use `\vv*{e}{r}`.
You can try manually like this: ``` \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{calc} %opening \title{} \author{} \def\tikzmark#1{\begin{tikzpicture}[remember picture]\node(#1){};\end{tikzpicture}} \makeatletter \renewcommand\vec[1]{\ifdefined\xsh\relax\else\pgf...
54,779,204
I've been following a tutorial exactly but my list isn't appending--I get the error, "AttributeError: 'list' object attribute 'append' is read-only." My code is: ``` mylist = [1,2,3] mylist.append = (4) ``` Thank you in advance.
2019/02/20
[ "https://Stackoverflow.com/questions/54779204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11039557/" ]
``` mylist = [1,2,3] mylist.append = (4) # Wrong!! ``` `append` is a method that is used to add an element to an existing list object. If the object contains 3 elements and you wish to append a new element to it, you can do it as follows: ``` mylist.append(4) ``` There is something very important to note here. Wh...
append is a function so use mylist.append(4) and it should work fine.
54,779,204
I've been following a tutorial exactly but my list isn't appending--I get the error, "AttributeError: 'list' object attribute 'append' is read-only." My code is: ``` mylist = [1,2,3] mylist.append = (4) ``` Thank you in advance.
2019/02/20
[ "https://Stackoverflow.com/questions/54779204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11039557/" ]
``` mylist = [1,2,3] mylist.append = (4) # Wrong!! ``` `append` is a method that is used to add an element to an existing list object. If the object contains 3 elements and you wish to append a new element to it, you can do it as follows: ``` mylist.append(4) ``` There is something very important to note here. Wh...
Welcome to programming! Append is a (read-only) function. You don't *assign* to it, you *call* it. ``` mylist.append(4) ``` is what you're looking for!
54,779,204
I've been following a tutorial exactly but my list isn't appending--I get the error, "AttributeError: 'list' object attribute 'append' is read-only." My code is: ``` mylist = [1,2,3] mylist.append = (4) ``` Thank you in advance.
2019/02/20
[ "https://Stackoverflow.com/questions/54779204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11039557/" ]
``` mylist = [1,2,3] mylist.append = (4) # Wrong!! ``` `append` is a method that is used to add an element to an existing list object. If the object contains 3 elements and you wish to append a new element to it, you can do it as follows: ``` mylist.append(4) ``` There is something very important to note here. Wh...
`append` is an attribute of List. If you want to append an item to your list use append as a function. ```py mylist = [1, 2, 3] mylist.append(4) print(mylist) >> [1, 2, 3, 4] ``` what you are currently doing it you are trying to override the `append` function to be = `4`
54,779,204
I've been following a tutorial exactly but my list isn't appending--I get the error, "AttributeError: 'list' object attribute 'append' is read-only." My code is: ``` mylist = [1,2,3] mylist.append = (4) ``` Thank you in advance.
2019/02/20
[ "https://Stackoverflow.com/questions/54779204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11039557/" ]
``` mylist = [1,2,3] mylist.append = (4) # Wrong!! ``` `append` is a method that is used to add an element to an existing list object. If the object contains 3 elements and you wish to append a new element to it, you can do it as follows: ``` mylist.append(4) ``` There is something very important to note here. Wh...
append is function it takes the argument which you want to append: e.g. .append()
54,779,204
I've been following a tutorial exactly but my list isn't appending--I get the error, "AttributeError: 'list' object attribute 'append' is read-only." My code is: ``` mylist = [1,2,3] mylist.append = (4) ``` Thank you in advance.
2019/02/20
[ "https://Stackoverflow.com/questions/54779204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11039557/" ]
Welcome to programming! Append is a (read-only) function. You don't *assign* to it, you *call* it. ``` mylist.append(4) ``` is what you're looking for!
append is a function so use mylist.append(4) and it should work fine.
54,779,204
I've been following a tutorial exactly but my list isn't appending--I get the error, "AttributeError: 'list' object attribute 'append' is read-only." My code is: ``` mylist = [1,2,3] mylist.append = (4) ``` Thank you in advance.
2019/02/20
[ "https://Stackoverflow.com/questions/54779204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11039557/" ]
append is a function so use mylist.append(4) and it should work fine.
append is function it takes the argument which you want to append: e.g. .append()
54,779,204
I've been following a tutorial exactly but my list isn't appending--I get the error, "AttributeError: 'list' object attribute 'append' is read-only." My code is: ``` mylist = [1,2,3] mylist.append = (4) ``` Thank you in advance.
2019/02/20
[ "https://Stackoverflow.com/questions/54779204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11039557/" ]
Welcome to programming! Append is a (read-only) function. You don't *assign* to it, you *call* it. ``` mylist.append(4) ``` is what you're looking for!
`append` is an attribute of List. If you want to append an item to your list use append as a function. ```py mylist = [1, 2, 3] mylist.append(4) print(mylist) >> [1, 2, 3, 4] ``` what you are currently doing it you are trying to override the `append` function to be = `4`
54,779,204
I've been following a tutorial exactly but my list isn't appending--I get the error, "AttributeError: 'list' object attribute 'append' is read-only." My code is: ``` mylist = [1,2,3] mylist.append = (4) ``` Thank you in advance.
2019/02/20
[ "https://Stackoverflow.com/questions/54779204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11039557/" ]
Welcome to programming! Append is a (read-only) function. You don't *assign* to it, you *call* it. ``` mylist.append(4) ``` is what you're looking for!
append is function it takes the argument which you want to append: e.g. .append()
54,779,204
I've been following a tutorial exactly but my list isn't appending--I get the error, "AttributeError: 'list' object attribute 'append' is read-only." My code is: ``` mylist = [1,2,3] mylist.append = (4) ``` Thank you in advance.
2019/02/20
[ "https://Stackoverflow.com/questions/54779204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11039557/" ]
`append` is an attribute of List. If you want to append an item to your list use append as a function. ```py mylist = [1, 2, 3] mylist.append(4) print(mylist) >> [1, 2, 3, 4] ``` what you are currently doing it you are trying to override the `append` function to be = `4`
append is function it takes the argument which you want to append: e.g. .append()
42,684,161
``` False in [True,True] False in pd.Series([True,True]) ``` the first line of code returns False the second line of code returns True! I think I must be doing something wrong or missing something here. I get the same thing when I check if the series has 0. Can someone please explain this to me?
2017/03/08
[ "https://Stackoverflow.com/questions/42684161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4098968/" ]
You are checking whether `0` (internal `False` representation) is in the Series's **index** - [@Uriel has shown a docstring explaining why is it happening](https://stackoverflow.com/a/42684247/5741205): ``` In [286]: False in pd.Series([True,True]) Out[286]: True ``` is the same as: ``` In [287]: 0 in pd.Series([Tr...
``` >>> help(pd.Series([True, True]).__contains__) Help on method __contains__ in module pandas.core.generic: __contains__(key) method of pandas.core.series.Series instance True if the key is in the info axis >>> pd.Series([True, True]) 0 True 1 True dtype: bool ^ info axis ```
42,684,161
``` False in [True,True] False in pd.Series([True,True]) ``` the first line of code returns False the second line of code returns True! I think I must be doing something wrong or missing something here. I get the same thing when I check if the series has 0. Can someone please explain this to me?
2017/03/08
[ "https://Stackoverflow.com/questions/42684161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4098968/" ]
You are checking whether `0` (internal `False` representation) is in the Series's **index** - [@Uriel has shown a docstring explaining why is it happening](https://stackoverflow.com/a/42684247/5741205): ``` In [286]: False in pd.Series([True,True]) Out[286]: True ``` is the same as: ``` In [287]: 0 in pd.Series([Tr...
If you are checking for more than one value, I highly recommend the [`isin` method](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.isin.html). ``` >>> pd.Series(range(10)).isin([1]).any() True ```
42,684,161
``` False in [True,True] False in pd.Series([True,True]) ``` the first line of code returns False the second line of code returns True! I think I must be doing something wrong or missing something here. I get the same thing when I check if the series has 0. Can someone please explain this to me?
2017/03/08
[ "https://Stackoverflow.com/questions/42684161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4098968/" ]
``` >>> help(pd.Series([True, True]).__contains__) Help on method __contains__ in module pandas.core.generic: __contains__(key) method of pandas.core.series.Series instance True if the key is in the info axis >>> pd.Series([True, True]) 0 True 1 True dtype: bool ^ info axis ```
If you are checking for more than one value, I highly recommend the [`isin` method](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.isin.html). ``` >>> pd.Series(range(10)).isin([1]).any() True ```
6,215,856
I wish to create a app that translates input java code into HTML formatted java code, For example: ``` public class ReadWithScanner ``` Would become ``` <span class="public">public</span> <span class="class">class</span> ReadWithScanner ``` However it gets quite complicated when it comes to parameters and reg...
2011/06/02
[ "https://Stackoverflow.com/questions/6215856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/760986/" ]
For help with the complexity of parsing, you'll need to rely on the [Java Language Specification](http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html). As I seem to recall, Java is an LL(k) language (see [here](http://www.google.com/url?sa=t&source=web&cd=6&ved=0CEUQFjAF&url=http://www.cs.virginia.edu/~ev...
I think you need a lexical analyzer. I used early the [Flex lexical analyzer](https://github.com/westes/flex/). It is not too complicated to use. If you need to parse the analyzed text you can use the bison c++ bisoncpp.sourceforge.net/ (C++ konwledge need and linux environment)
6,215,856
I wish to create a app that translates input java code into HTML formatted java code, For example: ``` public class ReadWithScanner ``` Would become ``` <span class="public">public</span> <span class="class">class</span> ReadWithScanner ``` However it gets quite complicated when it comes to parameters and reg...
2011/06/02
[ "https://Stackoverflow.com/questions/6215856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/760986/" ]
What you need to do is use ANTLR, it already has Java grammars for parsing Java, then you just need to supply your own templates to output whatever you want from the Abstract Syntax Tree you generate with ANTLR.
I think you need a lexical analyzer. I used early the [Flex lexical analyzer](https://github.com/westes/flex/). It is not too complicated to use. If you need to parse the analyzed text you can use the bison c++ bisoncpp.sourceforge.net/ (C++ konwledge need and linux environment)
6,215,856
I wish to create a app that translates input java code into HTML formatted java code, For example: ``` public class ReadWithScanner ``` Would become ``` <span class="public">public</span> <span class="class">class</span> ReadWithScanner ``` However it gets quite complicated when it comes to parameters and reg...
2011/06/02
[ "https://Stackoverflow.com/questions/6215856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/760986/" ]
For help with the complexity of parsing, you'll need to rely on the [Java Language Specification](http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html). As I seem to recall, Java is an LL(k) language (see [here](http://www.google.com/url?sa=t&source=web&cd=6&ved=0CEUQFjAF&url=http://www.cs.virginia.edu/~ev...
If you need a resource for learning about parsers, I can recommend [Basics of Compiler Design](http://www.diku.dk/hjemmesider/ansatte/torbenm/Basics/), which is available as a free download. It covers more than just parsers, but if you read the first few chapters, you should have a good basic understanding of both lex...
6,215,856
I wish to create a app that translates input java code into HTML formatted java code, For example: ``` public class ReadWithScanner ``` Would become ``` <span class="public">public</span> <span class="class">class</span> ReadWithScanner ``` However it gets quite complicated when it comes to parameters and reg...
2011/06/02
[ "https://Stackoverflow.com/questions/6215856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/760986/" ]
What you need to do is use ANTLR, it already has Java grammars for parsing Java, then you just need to supply your own templates to output whatever you want from the Abstract Syntax Tree you generate with ANTLR.
If you need a resource for learning about parsers, I can recommend [Basics of Compiler Design](http://www.diku.dk/hjemmesider/ansatte/torbenm/Basics/), which is available as a free download. It covers more than just parsers, but if you read the first few chapters, you should have a good basic understanding of both lex...
6,215,856
I wish to create a app that translates input java code into HTML formatted java code, For example: ``` public class ReadWithScanner ``` Would become ``` <span class="public">public</span> <span class="class">class</span> ReadWithScanner ``` However it gets quite complicated when it comes to parameters and reg...
2011/06/02
[ "https://Stackoverflow.com/questions/6215856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/760986/" ]
For help with the complexity of parsing, you'll need to rely on the [Java Language Specification](http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html). As I seem to recall, Java is an LL(k) language (see [here](http://www.google.com/url?sa=t&source=web&cd=6&ved=0CEUQFjAF&url=http://www.cs.virginia.edu/~ev...
What you need to do is use ANTLR, it already has Java grammars for parsing Java, then you just need to supply your own templates to output whatever you want from the Abstract Syntax Tree you generate with ANTLR.
524,594
Say we have a regular polygon $s$, with number of sides $n$: Is there a way to prove that as $n → ∞,\space $then $s → circle$ using integration?
2013/10/13
[ "https://math.stackexchange.com/questions/524594", "https://math.stackexchange.com", "https://math.stackexchange.com/users/92008/" ]
Denote length of side of a regular polygon as $s$, and the radius as $r$. Making a triangle for each of the $n$ sides in the polygon: $$s / 2 = r \times \sin\left(\frac{180}{n}\right)$$ Then the perimiter of the polygon is the length of each side times the number of sides: $$s \times n = 2\times r \times \sin\left(...
The pioneers of the calculus, including Leibniz, thought of a circle as an infinite-sided polygon, as the OP suggests. This turned out to be a fruitful idea, even though today we avoid this viewpoint. See [this answer](https://math.stackexchange.com/questions/518121/interesting-medieval-mathematics-lecture-activity-ide...
524,594
Say we have a regular polygon $s$, with number of sides $n$: Is there a way to prove that as $n → ∞,\space $then $s → circle$ using integration?
2013/10/13
[ "https://math.stackexchange.com/questions/524594", "https://math.stackexchange.com", "https://math.stackexchange.com/users/92008/" ]
Denote length of side of a regular polygon as $s$, and the radius as $r$. Making a triangle for each of the $n$ sides in the polygon: $$s / 2 = r \times \sin\left(\frac{180}{n}\right)$$ Then the perimiter of the polygon is the length of each side times the number of sides: $$s \times n = 2\times r \times \sin\left(...
Consider the equation for the measure of each an a regular polygon: $\frac{(n-2)180^\circ}{n} $ Now, consider the function :$$f(x)= \frac{(x-2)180}{x}$$ The limit of this function as $x$ approaches infinity is $180$. As $x$ gets very large, the measure of the angles inside the polygon with that amount of sides gets ...
524,594
Say we have a regular polygon $s$, with number of sides $n$: Is there a way to prove that as $n → ∞,\space $then $s → circle$ using integration?
2013/10/13
[ "https://math.stackexchange.com/questions/524594", "https://math.stackexchange.com", "https://math.stackexchange.com/users/92008/" ]
Denote length of side of a regular polygon as $s$, and the radius as $r$. Making a triangle for each of the $n$ sides in the polygon: $$s / 2 = r \times \sin\left(\frac{180}{n}\right)$$ Then the perimiter of the polygon is the length of each side times the number of sides: $$s \times n = 2\times r \times \sin\left(...
The statement "as $n\to\infty,$ then $s\to\text{circle}$" is much too informal to lead at all to something that is provable. The same goes with "$\lim\_{n\to\infty}p(n)=\text{circle}$" (in the comments).
44,240
I want to start learning 3d modeling. I already have experience with maya and 3dsmax but I made a long pause (2 years) Now I have free access to maya, 3dsmax and blender (I am a student). I know that all tools are very powerful so I thought I just pick the one with the best learning materials. The best site that I fo...
2012/11/22
[ "https://gamedev.stackexchange.com/questions/44240", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/14711/" ]
No, fetching them from the hard drive is very time-intensive. It is possible that you have so much texture/model/animation data that everything will not fit concurrently on the GPU, especially for someone using an older graphics card or laptop. Main memory is probably the cheapest resource you have to work with on a m...
You should generally free your mesh and texture data after uploading into OpenGL textures or vertex buffers. The driver must keep a copy of your data in any case, so why waste memory by keeping another useless copy around? Main memory may be cheap, but even so you shouldn't waste for no reason. Especially not on 32-bi...
44,240
I want to start learning 3d modeling. I already have experience with maya and 3dsmax but I made a long pause (2 years) Now I have free access to maya, 3dsmax and blender (I am a student). I know that all tools are very powerful so I thought I just pick the one with the best learning materials. The best site that I fo...
2012/11/22
[ "https://gamedev.stackexchange.com/questions/44240", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/14711/" ]
Loading and unloading resources at runtime is not practical. The only time you do that is when you are streaming resources. A general idea to go on is to load rescouers that you need for a current map or segment. and when the player is past that to unload the rescoures. Never keep something you dont need, but keep wh...
You should generally free your mesh and texture data after uploading into OpenGL textures or vertex buffers. The driver must keep a copy of your data in any case, so why waste memory by keeping another useless copy around? Main memory may be cheap, but even so you shouldn't waste for no reason. Especially not on 32-bi...
161,584
I am putting together a piece of equipment that will involve a vacuum pump pulling up to 10 Torr / 13 Mbar.  I need to use a container for liquid within the equipment and have found a stainless steel keg that the manufacturer states can withstand 130 psi.  Will this keg be strong enough to withstand the vacuum?
2015/01/26
[ "https://physics.stackexchange.com/questions/161584", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/71629/" ]
Honeycomb structures are certainly anisotropic. For example, the elasticity modulus in the direction orthogonal to the faces of the structures is much higher than in other directions. Please see the details in <http://www.hexcel.com/Resources/DataSheets/Brochure-Data-Sheets/Honeycomb_Sandwich_Design_Technology.pdf> at ...
you have to work within the framework of the brilloin zone on this honeycomb problem . It has non continous translational invariances so you can't really say it's isotropic... <http://en.wikipedia.org/wiki/Brillouin_zone>
8,313,990
As you know, dozer use same field name to mapping between two beans, but how can I just simple change this mapping strategy. ``` public class Product { private String productName; public String getProductName(){ return productName; } public void setProductName(String productName){ this.prod...
2011/11/29
[ "https://Stackoverflow.com/questions/8313990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1057442/" ]
Use jQuery's [`:empty`](http://api.jquery.com/empty/) selector: ``` $('.philosophy-bubble:empty').hide(); ``` Here's [a working fiddle](http://jsfiddle.net/JamesHill/F7M4U/). **Alternative** You could also use the [`filter()`](http://api.jquery.com/filter/) function to find all empty div's and hide: ``` //All div...
``` var myDiv = $('#myDiv'); if (myDiv.text() == '') { myDiv.hide(); } ```
8,313,990
As you know, dozer use same field name to mapping between two beans, but how can I just simple change this mapping strategy. ``` public class Product { private String productName; public String getProductName(){ return productName; } public void setProductName(String productName){ this.prod...
2011/11/29
[ "https://Stackoverflow.com/questions/8313990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1057442/" ]
``` var myDiv = $('#myDiv'); if (myDiv.text() == '') { myDiv.hide(); } ```
Something like: ``` if ($('.philosophy-bubble').is(":empty")){ $('.philosophy-bubble').hide(); } ``` here is a fiddle: <http://jsfiddle.net/IrvinDominin/XYr9T/1/> **EDIT** better by using: ``` $('.philosophy-bubble:empty').hide() ``` <http://jsfiddle.net/IrvinDominin/XYr9T/3/>
8,313,990
As you know, dozer use same field name to mapping between two beans, but how can I just simple change this mapping strategy. ``` public class Product { private String productName; public String getProductName(){ return productName; } public void setProductName(String productName){ this.prod...
2011/11/29
[ "https://Stackoverflow.com/questions/8313990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1057442/" ]
Use jQuery's [`:empty`](http://api.jquery.com/empty/) selector: ``` $('.philosophy-bubble:empty').hide(); ``` Here's [a working fiddle](http://jsfiddle.net/JamesHill/F7M4U/). **Alternative** You could also use the [`filter()`](http://api.jquery.com/filter/) function to find all empty div's and hide: ``` //All div...
Something like: ``` if ($('.philosophy-bubble').is(":empty")){ $('.philosophy-bubble').hide(); } ``` here is a fiddle: <http://jsfiddle.net/IrvinDominin/XYr9T/1/> **EDIT** better by using: ``` $('.philosophy-bubble:empty').hide() ``` <http://jsfiddle.net/IrvinDominin/XYr9T/3/>
32,756,288
This is the first time I'm submitting a form with jQuery. I know how to submit a form with PHP only (without jQuery validation before). ``` if (isset($_POST['submit-form'])) { ... // Do stuff here } ``` What I need to know is, how do I call the `isset($_POST['name']` after I submit a form with jQuery. This i...
2015/09/24
[ "https://Stackoverflow.com/questions/32756288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4118983/" ]
`<button>` tags do not submit a value - and you have no other values in your form to submit. Alter your form to this: ``` <form id="myForm" action="" method="post" enctype="multipart/form-data"> <input type="submit" name="submit-form" class="submit-button" value='Save'> <input type="hidden" name="test" value...
You can use this: ``` $("#myForm")[0].submit(); ``` just raise the `.submit()` DOM event instead of calling the jquery's `.submit()`. --- Also may be this could have been a typo, you are missing a `)` closing in if condition: ``` if (isset($_POST['submit-form'])) { ``` and you have missed a closing of the but...
32,756,288
This is the first time I'm submitting a form with jQuery. I know how to submit a form with PHP only (without jQuery validation before). ``` if (isset($_POST['submit-form'])) { ... // Do stuff here } ``` What I need to know is, how do I call the `isset($_POST['name']` after I submit a form with jQuery. This i...
2015/09/24
[ "https://Stackoverflow.com/questions/32756288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4118983/" ]
You can use this: ``` $("#myForm")[0].submit(); ``` just raise the `.submit()` DOM event instead of calling the jquery's `.submit()`. --- Also may be this could have been a typo, you are missing a `)` closing in if condition: ``` if (isset($_POST['submit-form'])) { ``` and you have missed a closing of the but...
``` $(":input").each(function() { if($(this).val() === "") alert("Empty Fields!!"); }); ```
32,756,288
This is the first time I'm submitting a form with jQuery. I know how to submit a form with PHP only (without jQuery validation before). ``` if (isset($_POST['submit-form'])) { ... // Do stuff here } ``` What I need to know is, how do I call the `isset($_POST['name']` after I submit a form with jQuery. This i...
2015/09/24
[ "https://Stackoverflow.com/questions/32756288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4118983/" ]
`<button>` tags do not submit a value - and you have no other values in your form to submit. Alter your form to this: ``` <form id="myForm" action="" method="post" enctype="multipart/form-data"> <input type="submit" name="submit-form" class="submit-button" value='Save'> <input type="hidden" name="test" value...
Try This: ``` $(".submit-button").click(function() { var name=$('#txtnameid').val(); if(name=="") { // Show error message } else { $(".myForm").submit(); } }); ```
32,756,288
This is the first time I'm submitting a form with jQuery. I know how to submit a form with PHP only (without jQuery validation before). ``` if (isset($_POST['submit-form'])) { ... // Do stuff here } ``` What I need to know is, how do I call the `isset($_POST['name']` after I submit a form with jQuery. This i...
2015/09/24
[ "https://Stackoverflow.com/questions/32756288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4118983/" ]
`<button>` tags do not submit a value - and you have no other values in your form to submit. Alter your form to this: ``` <form id="myForm" action="" method="post" enctype="multipart/form-data"> <input type="submit" name="submit-form" class="submit-button" value='Save'> <input type="hidden" name="test" value...
you can also try below step: * Before jquery code please include latest jquery file. * Also use button id not button class.
32,756,288
This is the first time I'm submitting a form with jQuery. I know how to submit a form with PHP only (without jQuery validation before). ``` if (isset($_POST['submit-form'])) { ... // Do stuff here } ``` What I need to know is, how do I call the `isset($_POST['name']` after I submit a form with jQuery. This i...
2015/09/24
[ "https://Stackoverflow.com/questions/32756288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4118983/" ]
`<button>` tags do not submit a value - and you have no other values in your form to submit. Alter your form to this: ``` <form id="myForm" action="" method="post" enctype="multipart/form-data"> <input type="submit" name="submit-form" class="submit-button" value='Save'> <input type="hidden" name="test" value...
``` $(":input").each(function() { if($(this).val() === "") alert("Empty Fields!!"); }); ```
32,756,288
This is the first time I'm submitting a form with jQuery. I know how to submit a form with PHP only (without jQuery validation before). ``` if (isset($_POST['submit-form'])) { ... // Do stuff here } ``` What I need to know is, how do I call the `isset($_POST['name']` after I submit a form with jQuery. This i...
2015/09/24
[ "https://Stackoverflow.com/questions/32756288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4118983/" ]
Try This: ``` $(".submit-button").click(function() { var name=$('#txtnameid').val(); if(name=="") { // Show error message } else { $(".myForm").submit(); } }); ```
``` $(":input").each(function() { if($(this).val() === "") alert("Empty Fields!!"); }); ```
32,756,288
This is the first time I'm submitting a form with jQuery. I know how to submit a form with PHP only (without jQuery validation before). ``` if (isset($_POST['submit-form'])) { ... // Do stuff here } ``` What I need to know is, how do I call the `isset($_POST['name']` after I submit a form with jQuery. This i...
2015/09/24
[ "https://Stackoverflow.com/questions/32756288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4118983/" ]
you can also try below step: * Before jquery code please include latest jquery file. * Also use button id not button class.
``` $(":input").each(function() { if($(this).val() === "") alert("Empty Fields!!"); }); ```
54,059,811
I am doing the atoi problem in leetcode and I submitted my code below which isn't too important. I am wondering if it is a valid failure leetcode gave me. It seems like my code is doing the right thing. Here is the problem description: [![enter image description here](https://i.stack.imgur.com/7inMh.png)](https://i.s...
2019/01/06
[ "https://Stackoverflow.com/questions/54059811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5385625/" ]
The specification is ambiguous "if the numerical value is out of the range of representable values INT\_MAX or INT\_MIN is retuned". The authors had in mind to return the value matching in sign but this is not clearly stated. So I would say when you return INT\_MIN for a number that is larger than INT\_MAX this could ...
Without checking your algorithm I can see the following in the error message: The maximum 32bit int value is 2,147,483,647 which is expected to be returned when you get a string representing a larger value than that (e.g. your input was `"2147483648"` which is larger by one). Your program apparently returns `-21474836...
76,412
1. Is this the last exam of you guys? 2. Is this the last exam for you guys? Could you explain which sentence is correct?
2015/12/18
[ "https://ell.stackexchange.com/questions/76412", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
The following definition of **for** is now obsolete, but it survives in few expressions like this one. [![enter image description here](https://i.stack.imgur.com/CCmkJ.jpg)](https://i.stack.imgur.com/CCmkJ.jpg) [![enter image description here](https://i.stack.imgur.com/ekUF6.jpg)](https://i.stack.imgur.com/ekUF6.jpg) ...
The expression "mistake X **for** Y" takes "for". It is simply set like that as a *phrasal verb*. <http://www.oxfordlearnersdictionaries.com/definition/english/mistake-for> <http://dictionary.cambridge.org/dictionary/english/mistake-sb-sth-for-sb-sth> To "mistake X for Y" means that you **wrongly identified** X (whi...
76,412
1. Is this the last exam of you guys? 2. Is this the last exam for you guys? Could you explain which sentence is correct?
2015/12/18
[ "https://ell.stackexchange.com/questions/76412", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
The following definition of **for** is now obsolete, but it survives in few expressions like this one. [![enter image description here](https://i.stack.imgur.com/CCmkJ.jpg)](https://i.stack.imgur.com/CCmkJ.jpg) [![enter image description here](https://i.stack.imgur.com/ekUF6.jpg)](https://i.stack.imgur.com/ekUF6.jpg) ...
> > Don't mistake my confidence for arrogance. > > > Don't mistake my confidence as arrogance. > > > I think there's no difference in meaning between these sentences. When you misunderstand or misjudge someone or something to be someone or something else, you can use either "as" or "for" after the verb "mistake,...
55,333,968
I have a simple Json String ``` [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "required":true, "valueInput":"{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}" } ]...
2019/03/25
[ "https://Stackoverflow.com/questions/55333968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7665222/" ]
You need to loop through the array and then parse the stringified JSON so that you can access the `data` array. Then simply loop that `data` array to get the value of each `name` property. ```js var arr = [{ "assetName": "LCT", "assetValue": "", "typeValueInput": "select", "valueInputSelect": null, "req...
You can use an `array` variable and the callback function of `JSON.parse` to get the name `key` & `val` ```js let dt = [{ "assetName": "LCT", "assetValue": "", "typeValueInput": "select", "valueInputSelect": null, "required": true, "valueInput": "{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\...
55,333,968
I have a simple Json String ``` [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "required":true, "valueInput":"{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}" } ]...
2019/03/25
[ "https://Stackoverflow.com/questions/55333968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7665222/" ]
You could use `JSON.parse` ```js var jsonArray = [ { assetName: 'LCT', assetValue: '', typeValueInput: 'select', valueInputSelect: null, required: true, valueInput: '{"data":[{"name":"name1","id":"12"},{"name":"name2","id":"13"},{"name":"name3","id":"14"}]}' } ]; let name ...
You can do: ```js const arr = [{"assetName": "LCT","assetValue": "","typeValueInput": "select","valueInputSelect": null,"required": true,"valueInput": "{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}"}]; arr.forEach(o => JSON.parse(o.valueInput).d...
55,333,968
I have a simple Json String ``` [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "required":true, "valueInput":"{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}" } ]...
2019/03/25
[ "https://Stackoverflow.com/questions/55333968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7665222/" ]
Use `JSON.parse`, and use `map`: ```js const data = [{ "assetName": "LCT", "assetValue": "", "typeValueInput": "select", "valueInputSelect": null, "required": true, "valueInput": "{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}" }...
Here is a way to do it. ``` let originalData = [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "required":true, "valueInput":"{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"...
55,333,968
I have a simple Json String ``` [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "required":true, "valueInput":"{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}" } ]...
2019/03/25
[ "https://Stackoverflow.com/questions/55333968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7665222/" ]
You need to loop through the array and then parse the stringified JSON so that you can access the `data` array. Then simply loop that `data` array to get the value of each `name` property. ```js var arr = [{ "assetName": "LCT", "assetValue": "", "typeValueInput": "select", "valueInputSelect": null, "req...
Here is a way to do it. ``` let originalData = [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "required":true, "valueInput":"{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"...
55,333,968
I have a simple Json String ``` [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "required":true, "valueInput":"{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}" } ]...
2019/03/25
[ "https://Stackoverflow.com/questions/55333968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7665222/" ]
You could use `JSON.parse` ```js var jsonArray = [ { assetName: 'LCT', assetValue: '', typeValueInput: 'select', valueInputSelect: null, required: true, valueInput: '{"data":[{"name":"name1","id":"12"},{"name":"name2","id":"13"},{"name":"name3","id":"14"}]}' } ]; let name ...
You can use [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) ``` JSON.parse(o[0].valueInput).data[0].name ``` ```js var o = [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "re...
55,333,968
I have a simple Json String ``` [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "required":true, "valueInput":"{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}" } ]...
2019/03/25
[ "https://Stackoverflow.com/questions/55333968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7665222/" ]
You need to loop through the array and then parse the stringified JSON so that you can access the `data` array. Then simply loop that `data` array to get the value of each `name` property. ```js var arr = [{ "assetName": "LCT", "assetValue": "", "typeValueInput": "select", "valueInputSelect": null, "req...
You can do: ```js const arr = [{"assetName": "LCT","assetValue": "","typeValueInput": "select","valueInputSelect": null,"required": true,"valueInput": "{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}"}]; arr.forEach(o => JSON.parse(o.valueInput).d...
55,333,968
I have a simple Json String ``` [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "required":true, "valueInput":"{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}" } ]...
2019/03/25
[ "https://Stackoverflow.com/questions/55333968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7665222/" ]
You need to loop through the array and then parse the stringified JSON so that you can access the `data` array. Then simply loop that `data` array to get the value of each `name` property. ```js var arr = [{ "assetName": "LCT", "assetValue": "", "typeValueInput": "select", "valueInputSelect": null, "req...
You could use `JSON.parse` ```js var jsonArray = [ { assetName: 'LCT', assetValue: '', typeValueInput: 'select', valueInputSelect: null, required: true, valueInput: '{"data":[{"name":"name1","id":"12"},{"name":"name2","id":"13"},{"name":"name3","id":"14"}]}' } ]; let name ...
55,333,968
I have a simple Json String ``` [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "required":true, "valueInput":"{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}" } ]...
2019/03/25
[ "https://Stackoverflow.com/questions/55333968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7665222/" ]
You need to loop through the array and then parse the stringified JSON so that you can access the `data` array. Then simply loop that `data` array to get the value of each `name` property. ```js var arr = [{ "assetName": "LCT", "assetValue": "", "typeValueInput": "select", "valueInputSelect": null, "req...
You can use [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) ``` JSON.parse(o[0].valueInput).data[0].name ``` ```js var o = [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "re...
55,333,968
I have a simple Json String ``` [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "required":true, "valueInput":"{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}" } ]...
2019/03/25
[ "https://Stackoverflow.com/questions/55333968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7665222/" ]
You could use `JSON.parse` ```js var jsonArray = [ { assetName: 'LCT', assetValue: '', typeValueInput: 'select', valueInputSelect: null, required: true, valueInput: '{"data":[{"name":"name1","id":"12"},{"name":"name2","id":"13"},{"name":"name3","id":"14"}]}' } ]; let name ...
You can use an `array` variable and the callback function of `JSON.parse` to get the name `key` & `val` ```js let dt = [{ "assetName": "LCT", "assetValue": "", "typeValueInput": "select", "valueInputSelect": null, "required": true, "valueInput": "{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\...
55,333,968
I have a simple Json String ``` [ { "assetName":"LCT", "assetValue":"", "typeValueInput":"select", "valueInputSelect":null, "required":true, "valueInput":"{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}" } ]...
2019/03/25
[ "https://Stackoverflow.com/questions/55333968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7665222/" ]
Use `JSON.parse`, and use `map`: ```js const data = [{ "assetName": "LCT", "assetValue": "", "typeValueInput": "select", "valueInputSelect": null, "required": true, "valueInput": "{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}" }...
You can do: ```js const arr = [{"assetName": "LCT","assetValue": "","typeValueInput": "select","valueInputSelect": null,"required": true,"valueInput": "{\"data\":[{\"name\":\"name1\",\"id\":\"12\"},{\"name\":\"name2\",\"id\":\"13\"},{\"name\":\"name3\",\"id\":\"14\"}]}"}]; arr.forEach(o => JSON.parse(o.valueInput).d...
56,671,550
I want to generate a list of dictionaries of ALL combinations that are derived from 3 list of dictionaries combining their keys: ``` products = [{'product':'product1'},{'product':'product2'},{'product':'product3'},{'product':'product4'}] sales = [{'sale':'sale1'},{'sale':'sale2'}] invoices = [{'invoice':'invoice1'},...
2019/06/19
[ "https://Stackoverflow.com/questions/56671550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1292656/" ]
You can use `itertools.product` with dictionary unpacking: ``` from itertools import product products = [{'product':'product1'},{'product':'product2'},{'product':'product3'},{'product':'product4'}] sales = [{'sale':'sale1'},{'sale':'sale2'}] invoices = [{'invoice':'invoice1'},{'invoice': 'invoice2'},{'invoice':'invoic...
You could also use [`collections.ChainMap()`](https://docs.python.org/3/library/collections.html#collections.ChainMap) to the merge the cartesian products from [`itertools.product()`](https://docs.python.org/3.7/library/itertools.html#itertools.product): ``` from collections import ChainMap from itertools import produ...
8,094,256
I want to know programmatic way to get the memory consumed by my user defined class. Following is the declaration of the class ``` struct TrieNode { typedef std::map<char, TrieNode *> ChildType; std::string m_word; bool m_visited; } ``` I have inserted around `264061` words into this `Trie`. Afte...
2011/11/11
[ "https://Stackoverflow.com/questions/8094256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92568/" ]
I use ``` valgrind --tool=massif ./myprogram -opt arg1 arg2 ms_print massif.* | less -SR ``` for that. Sample output from [this page](http://valgrind.org/docs/manual/ms-manual.html) ``` 19.63^ ### | ...
Well, this is not so easy to do. First of all m\_word is a string with variable size right? Internally the std::string holds an array of chars among other things. The same stands for std::map. I guess you could get a rough estimation based on the size of the map \* TrieNode but this will be just a rough estimate. I th...
8,094,256
I want to know programmatic way to get the memory consumed by my user defined class. Following is the declaration of the class ``` struct TrieNode { typedef std::map<char, TrieNode *> ChildType; std::string m_word; bool m_visited; } ``` I have inserted around `264061` words into this `Trie`. Afte...
2011/11/11
[ "https://Stackoverflow.com/questions/8094256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92568/" ]
Well, this is not so easy to do. First of all m\_word is a string with variable size right? Internally the std::string holds an array of chars among other things. The same stands for std::map. I guess you could get a rough estimation based on the size of the map \* TrieNode but this will be just a rough estimate. I th...
Trivial. **If** you have some time (which might be the case, if you are only interested in the size for debugging/optimising purposes). This approach might be unsuited for production code! ``` #include <malloc.h> template <typename T> int objSize(T const* obj) { // instead of uordblks, you may be interested in 'are...
8,094,256
I want to know programmatic way to get the memory consumed by my user defined class. Following is the declaration of the class ``` struct TrieNode { typedef std::map<char, TrieNode *> ChildType; std::string m_word; bool m_visited; } ``` I have inserted around `264061` words into this `Trie`. Afte...
2011/11/11
[ "https://Stackoverflow.com/questions/8094256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92568/" ]
Well, this is not so easy to do. First of all m\_word is a string with variable size right? Internally the std::string holds an array of chars among other things. The same stands for std::map. I guess you could get a rough estimation based on the size of the map \* TrieNode but this will be just a rough estimate. I th...
Your "object size" is sizeof(std::string) + sizeof(bool) + m\_word.capacity() + padding bytes or sizeof(trieobject) + m\_word.capacity()
8,094,256
I want to know programmatic way to get the memory consumed by my user defined class. Following is the declaration of the class ``` struct TrieNode { typedef std::map<char, TrieNode *> ChildType; std::string m_word; bool m_visited; } ``` I have inserted around `264061` words into this `Trie`. Afte...
2011/11/11
[ "https://Stackoverflow.com/questions/8094256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92568/" ]
Well, this is not so easy to do. First of all m\_word is a string with variable size right? Internally the std::string holds an array of chars among other things. The same stands for std::map. I guess you could get a rough estimation based on the size of the map \* TrieNode but this will be just a rough estimate. I th...
Here's a piece of code for GCC that I came up with that you can use in a test program where you only instantiate one object of your class and do some typical work with it. The code replaces the global `operator new()` and `operator delete()`; so it will only track allocations through `::new` expressions and the standar...
8,094,256
I want to know programmatic way to get the memory consumed by my user defined class. Following is the declaration of the class ``` struct TrieNode { typedef std::map<char, TrieNode *> ChildType; std::string m_word; bool m_visited; } ``` I have inserted around `264061` words into this `Trie`. Afte...
2011/11/11
[ "https://Stackoverflow.com/questions/8094256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92568/" ]
I use ``` valgrind --tool=massif ./myprogram -opt arg1 arg2 ms_print massif.* | less -SR ``` for that. Sample output from [this page](http://valgrind.org/docs/manual/ms-manual.html) ``` 19.63^ ### | ...
Trivial. **If** you have some time (which might be the case, if you are only interested in the size for debugging/optimising purposes). This approach might be unsuited for production code! ``` #include <malloc.h> template <typename T> int objSize(T const* obj) { // instead of uordblks, you may be interested in 'are...
8,094,256
I want to know programmatic way to get the memory consumed by my user defined class. Following is the declaration of the class ``` struct TrieNode { typedef std::map<char, TrieNode *> ChildType; std::string m_word; bool m_visited; } ``` I have inserted around `264061` words into this `Trie`. Afte...
2011/11/11
[ "https://Stackoverflow.com/questions/8094256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92568/" ]
I use ``` valgrind --tool=massif ./myprogram -opt arg1 arg2 ms_print massif.* | less -SR ``` for that. Sample output from [this page](http://valgrind.org/docs/manual/ms-manual.html) ``` 19.63^ ### | ...
Your "object size" is sizeof(std::string) + sizeof(bool) + m\_word.capacity() + padding bytes or sizeof(trieobject) + m\_word.capacity()
8,094,256
I want to know programmatic way to get the memory consumed by my user defined class. Following is the declaration of the class ``` struct TrieNode { typedef std::map<char, TrieNode *> ChildType; std::string m_word; bool m_visited; } ``` I have inserted around `264061` words into this `Trie`. Afte...
2011/11/11
[ "https://Stackoverflow.com/questions/8094256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92568/" ]
I use ``` valgrind --tool=massif ./myprogram -opt arg1 arg2 ms_print massif.* | less -SR ``` for that. Sample output from [this page](http://valgrind.org/docs/manual/ms-manual.html) ``` 19.63^ ### | ...
Here's a piece of code for GCC that I came up with that you can use in a test program where you only instantiate one object of your class and do some typical work with it. The code replaces the global `operator new()` and `operator delete()`; so it will only track allocations through `::new` expressions and the standar...
8,094,256
I want to know programmatic way to get the memory consumed by my user defined class. Following is the declaration of the class ``` struct TrieNode { typedef std::map<char, TrieNode *> ChildType; std::string m_word; bool m_visited; } ``` I have inserted around `264061` words into this `Trie`. Afte...
2011/11/11
[ "https://Stackoverflow.com/questions/8094256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92568/" ]
Your "object size" is sizeof(std::string) + sizeof(bool) + m\_word.capacity() + padding bytes or sizeof(trieobject) + m\_word.capacity()
Trivial. **If** you have some time (which might be the case, if you are only interested in the size for debugging/optimising purposes). This approach might be unsuited for production code! ``` #include <malloc.h> template <typename T> int objSize(T const* obj) { // instead of uordblks, you may be interested in 'are...
8,094,256
I want to know programmatic way to get the memory consumed by my user defined class. Following is the declaration of the class ``` struct TrieNode { typedef std::map<char, TrieNode *> ChildType; std::string m_word; bool m_visited; } ``` I have inserted around `264061` words into this `Trie`. Afte...
2011/11/11
[ "https://Stackoverflow.com/questions/8094256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92568/" ]
Here's a piece of code for GCC that I came up with that you can use in a test program where you only instantiate one object of your class and do some typical work with it. The code replaces the global `operator new()` and `operator delete()`; so it will only track allocations through `::new` expressions and the standar...
Trivial. **If** you have some time (which might be the case, if you are only interested in the size for debugging/optimising purposes). This approach might be unsuited for production code! ``` #include <malloc.h> template <typename T> int objSize(T const* obj) { // instead of uordblks, you may be interested in 'are...
354,992
We know that Gauss Law for some volume $V$ with surface $\partial V$ is: $$\int\_{\partial V} \vec E \cdot \vec n dS = \int\_V \frac{\rho}{\epsilon\_0}dV$$ What it means is that if there is charge inside $V$ then it will generate a field and the total flux of that field through the surface $\partial V$ is proportiona...
2017/09/01
[ "https://physics.stackexchange.com/questions/354992", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/139868/" ]
Your calculation of the work is correct if the $-0.35\times 10^5$ J is the work W done by the surroundings on the gas. But you are not done yet. The first law tells us that $$Q+W=\Delta U$$ where Q is the *thermal energy transferred to the gas* from the surroundings and $\Delta U$ is the change in internal energy of th...
Fo the monoathomic gas you have to take de thermal energy transferred as $\frac{3}{2}nR\Delta T$. You can calculate the temperature in B and A and put into the formula. Calculating the work does not help as far as you don't know the amount of heat exchange between A and B...
36,808,260
I recently had to solve a problem in a real data system with a nested dict/list combination. I worked on this for quite a while and came up with a solution, but I am very unsatisfied. I had to resort to using `globals()` and a named temporary global parameter. I do not like to use globals. That's just asking for an i...
2016/04/23
[ "https://Stackoverflow.com/questions/36808260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2892074/" ]
This is a slightly modified version without using globals. Set `h` to `None` as default and create a new list for the first call to `_get_recursive_results()`. Later provide `h` as an argument in the recursive calls to `_get_recursive_results()`: ``` def _get_recursive_results(d, iter_key, get_keys, h=None): if h ...
This is not as generic but it does the job: ``` def parse_tree(d, keys): result = [{key: d[key] for key in keys}] l = d.get('l', None) if l is not None: entries = l.get('m', []) for entry in entries: result.extend(parse_tree(entry)) return result >>> parse_tree(d, ['k', 'stuff']) ...
36,808,260
I recently had to solve a problem in a real data system with a nested dict/list combination. I worked on this for quite a while and came up with a solution, but I am very unsatisfied. I had to resort to using `globals()` and a named temporary global parameter. I do not like to use globals. That's just asking for an i...
2016/04/23
[ "https://Stackoverflow.com/questions/36808260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2892074/" ]
This is not as generic but it does the job: ``` def parse_tree(d, keys): result = [{key: d[key] for key in keys}] l = d.get('l', None) if l is not None: entries = l.get('m', []) for entry in entries: result.extend(parse_tree(entry)) return result >>> parse_tree(d, ['k', 'stuff']) ...
I verified it works. Please check it. Of course, it should be modified when you change the structure of dictionary-list. ``` def add(ret, val): if val is not None: ret.append(val) def flatten(d, ret): for k,v in d.items(): if isinstance(v, dict): add(ret,flatten(v, ret)) elif isinstance(v, list): ...
36,808,260
I recently had to solve a problem in a real data system with a nested dict/list combination. I worked on this for quite a while and came up with a solution, but I am very unsatisfied. I had to resort to using `globals()` and a named temporary global parameter. I do not like to use globals. That's just asking for an i...
2016/04/23
[ "https://Stackoverflow.com/questions/36808260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2892074/" ]
I verified it works. Please check it. Of course, it should be modified when you change the structure of dictionary-list. ``` def add(ret, val): if val is not None: ret.append(val) def flatten(d, ret): for k,v in d.items(): if isinstance(v, dict): add(ret,flatten(v, ret)) elif isinstance(v, list): ...
Take a look at <https://github.com/akesterson/dpath-python/blob/master/README.rst> It a nice way of searching over a dict
36,808,260
I recently had to solve a problem in a real data system with a nested dict/list combination. I worked on this for quite a while and came up with a solution, but I am very unsatisfied. I had to resort to using `globals()` and a named temporary global parameter. I do not like to use globals. That's just asking for an i...
2016/04/23
[ "https://Stackoverflow.com/questions/36808260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2892074/" ]
This is not as generic but it does the job: ``` def parse_tree(d, keys): result = [{key: d[key] for key in keys}] l = d.get('l', None) if l is not None: entries = l.get('m', []) for entry in entries: result.extend(parse_tree(entry)) return result >>> parse_tree(d, ['k', 'stuff']) ...
Use generator ============= With following generator: ``` def get_stuff(dct, iter_keys, get_keys): k, stuff = get_keys l, m = iter_keys if k in dct: yield {k: dct[k], stuff: dct[stuff]} if dct.get(l): for subdct in dct[l][m]: for res in get_stuff(subdct, iter_ke...
36,808,260
I recently had to solve a problem in a real data system with a nested dict/list combination. I worked on this for quite a while and came up with a solution, but I am very unsatisfied. I had to resort to using `globals()` and a named temporary global parameter. I do not like to use globals. That's just asking for an i...
2016/04/23
[ "https://Stackoverflow.com/questions/36808260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2892074/" ]
Use generator ============= With following generator: ``` def get_stuff(dct, iter_keys, get_keys): k, stuff = get_keys l, m = iter_keys if k in dct: yield {k: dct[k], stuff: dct[stuff]} if dct.get(l): for subdct in dct[l][m]: for res in get_stuff(subdct, iter_ke...
Take a look at <https://github.com/akesterson/dpath-python/blob/master/README.rst> It a nice way of searching over a dict
36,808,260
I recently had to solve a problem in a real data system with a nested dict/list combination. I worked on this for quite a while and came up with a solution, but I am very unsatisfied. I had to resort to using `globals()` and a named temporary global parameter. I do not like to use globals. That's just asking for an i...
2016/04/23
[ "https://Stackoverflow.com/questions/36808260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2892074/" ]
This is not as generic but it does the job: ``` def parse_tree(d, keys): result = [{key: d[key] for key in keys}] l = d.get('l', None) if l is not None: entries = l.get('m', []) for entry in entries: result.extend(parse_tree(entry)) return result >>> parse_tree(d, ['k', 'stuff']) ...
Edit: First version had a bug which is now corrected I believe this should work, we're using the power of *recursion!* ``` def strip_leaves_from_tree(my_tree): result = list() row = dict() for key in my_tree: child = my_tree[key] if type(child) in (int, str,): row[key] = child ...
36,808,260
I recently had to solve a problem in a real data system with a nested dict/list combination. I worked on this for quite a while and came up with a solution, but I am very unsatisfied. I had to resort to using `globals()` and a named temporary global parameter. I do not like to use globals. That's just asking for an i...
2016/04/23
[ "https://Stackoverflow.com/questions/36808260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2892074/" ]
This is a slightly modified version without using globals. Set `h` to `None` as default and create a new list for the first call to `_get_recursive_results()`. Later provide `h` as an argument in the recursive calls to `_get_recursive_results()`: ``` def _get_recursive_results(d, iter_key, get_keys, h=None): if h ...
Edit: First version had a bug which is now corrected I believe this should work, we're using the power of *recursion!* ``` def strip_leaves_from_tree(my_tree): result = list() row = dict() for key in my_tree: child = my_tree[key] if type(child) in (int, str,): row[key] = child ...
36,808,260
I recently had to solve a problem in a real data system with a nested dict/list combination. I worked on this for quite a while and came up with a solution, but I am very unsatisfied. I had to resort to using `globals()` and a named temporary global parameter. I do not like to use globals. That's just asking for an i...
2016/04/23
[ "https://Stackoverflow.com/questions/36808260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2892074/" ]
This is not as generic but it does the job: ``` def parse_tree(d, keys): result = [{key: d[key] for key in keys}] l = d.get('l', None) if l is not None: entries = l.get('m', []) for entry in entries: result.extend(parse_tree(entry)) return result >>> parse_tree(d, ['k', 'stuff']) ...
Take a look at <https://github.com/akesterson/dpath-python/blob/master/README.rst> It a nice way of searching over a dict