qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
10,313,032
I have a table within a form. The table contains some form fields, but there are form fields outside of the table (but still within the form) too. I know that Enter and Return are traditionally used to submit a form via the keyboard, but I want to stop this behaviour for fields within the table. For example, if I focu...
2012/04/25
[ "https://Stackoverflow.com/questions/10313032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102205/" ]
``` base.keypress(function(e) { var code = e.keyCode || e.which; if(code == 13) return false; }); ``` or for only inputs: ``` $(':input', base).keypress(function(e) { var code = e.keyCode || e.which; if(code == 13) return false; }); ```
`e.preventDefault()` rather than `e.stopPropagation()`. stopPropagation only stops it bubbling up to higher DOM nodes, it doesn't prevent the default action.
10,313,032
I have a table within a form. The table contains some form fields, but there are form fields outside of the table (but still within the form) too. I know that Enter and Return are traditionally used to submit a form via the keyboard, but I want to stop this behaviour for fields within the table. For example, if I focu...
2012/04/25
[ "https://Stackoverflow.com/questions/10313032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102205/" ]
``` base.keypress(function(e) { var code = e.keyCode || e.which; if(code == 13) return false; }); ``` or for only inputs: ``` $(':input', base).keypress(function(e) { var code = e.keyCode || e.which; if(code == 13) return false; }); ```
Just put below code in your template file or in header of page. ``` <script type="text/javascript"> function stopRKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) {retu...
10,313,032
I have a table within a form. The table contains some form fields, but there are form fields outside of the table (but still within the form) too. I know that Enter and Return are traditionally used to submit a form via the keyboard, but I want to stop this behaviour for fields within the table. For example, if I focu...
2012/04/25
[ "https://Stackoverflow.com/questions/10313032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102205/" ]
``` base.keypress(function(e) { var code = e.keyCode || e.which; if(code == 13) return false; }); ``` or for only inputs: ``` $(':input', base).keypress(function(e) { var code = e.keyCode || e.which; if(code == 13) return false; }); ```
I found this Q/A trying to sort out a similar situation where I have multiple forms and enter would not do what I wanted. In my specific case, I would dynamically add a new `<div id="D1">` D1, D2, D3, etc, and each new div has a form that would reload that div from the same php code that created it, only also with a PO...
10,313,032
I have a table within a form. The table contains some form fields, but there are form fields outside of the table (but still within the form) too. I know that Enter and Return are traditionally used to submit a form via the keyboard, but I want to stop this behaviour for fields within the table. For example, if I focu...
2012/04/25
[ "https://Stackoverflow.com/questions/10313032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102205/" ]
`e.preventDefault()` rather than `e.stopPropagation()`. stopPropagation only stops it bubbling up to higher DOM nodes, it doesn't prevent the default action.
Just put below code in your template file or in header of page. ``` <script type="text/javascript"> function stopRKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) {retu...
10,313,032
I have a table within a form. The table contains some form fields, but there are form fields outside of the table (but still within the form) too. I know that Enter and Return are traditionally used to submit a form via the keyboard, but I want to stop this behaviour for fields within the table. For example, if I focu...
2012/04/25
[ "https://Stackoverflow.com/questions/10313032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102205/" ]
I'm going to guess that a form element will fire the submit event, it doesn't bubble up through the table and on to the form, try this instread: ``` $('input, select, textarea', base).on('keydown', function(e) { if (e.keyCode == 13) { return false; } }); ``` Note we're also providing context to the s...
I found this Q/A trying to sort out a similar situation where I have multiple forms and enter would not do what I wanted. In my specific case, I would dynamically add a new `<div id="D1">` D1, D2, D3, etc, and each new div has a form that would reload that div from the same php code that created it, only also with a PO...
10,313,032
I have a table within a form. The table contains some form fields, but there are form fields outside of the table (but still within the form) too. I know that Enter and Return are traditionally used to submit a form via the keyboard, but I want to stop this behaviour for fields within the table. For example, if I focu...
2012/04/25
[ "https://Stackoverflow.com/questions/10313032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102205/" ]
``` base.keypress(function(e) { var code = e.keyCode || e.which; if(code == 13) return false; }); ``` or for only inputs: ``` $(':input', base).keypress(function(e) { var code = e.keyCode || e.which; if(code == 13) return false; }); ```
I'm going to guess that a form element will fire the submit event, it doesn't bubble up through the table and on to the form, try this instread: ``` $('input, select, textarea', base).on('keydown', function(e) { if (e.keyCode == 13) { return false; } }); ``` Note we're also providing context to the s...
10,313,032
I have a table within a form. The table contains some form fields, but there are form fields outside of the table (but still within the form) too. I know that Enter and Return are traditionally used to submit a form via the keyboard, but I want to stop this behaviour for fields within the table. For example, if I focu...
2012/04/25
[ "https://Stackoverflow.com/questions/10313032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102205/" ]
`e.preventDefault()` rather than `e.stopPropagation()`. stopPropagation only stops it bubbling up to higher DOM nodes, it doesn't prevent the default action.
I found this Q/A trying to sort out a similar situation where I have multiple forms and enter would not do what I wanted. In my specific case, I would dynamically add a new `<div id="D1">` D1, D2, D3, etc, and each new div has a form that would reload that div from the same php code that created it, only also with a PO...
10,313,032
I have a table within a form. The table contains some form fields, but there are form fields outside of the table (but still within the form) too. I know that Enter and Return are traditionally used to submit a form via the keyboard, but I want to stop this behaviour for fields within the table. For example, if I focu...
2012/04/25
[ "https://Stackoverflow.com/questions/10313032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102205/" ]
I'm going to guess that a form element will fire the submit event, it doesn't bubble up through the table and on to the form, try this instread: ``` $('input, select, textarea', base).on('keydown', function(e) { if (e.keyCode == 13) { return false; } }); ``` Note we're also providing context to the s...
This works for me. ``` $("input[type='text']").on('keypress', function(e) { return e.keyCode != 13; }); ```
10,313,032
I have a table within a form. The table contains some form fields, but there are form fields outside of the table (but still within the form) too. I know that Enter and Return are traditionally used to submit a form via the keyboard, but I want to stop this behaviour for fields within the table. For example, if I focu...
2012/04/25
[ "https://Stackoverflow.com/questions/10313032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102205/" ]
I found this Q/A trying to sort out a similar situation where I have multiple forms and enter would not do what I wanted. In my specific case, I would dynamically add a new `<div id="D1">` D1, D2, D3, etc, and each new div has a form that would reload that div from the same php code that created it, only also with a PO...
Just put below code in your template file or in header of page. ``` <script type="text/javascript"> function stopRKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) {retu...
10,313,032
I have a table within a form. The table contains some form fields, but there are form fields outside of the table (but still within the form) too. I know that Enter and Return are traditionally used to submit a form via the keyboard, but I want to stop this behaviour for fields within the table. For example, if I focu...
2012/04/25
[ "https://Stackoverflow.com/questions/10313032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102205/" ]
`e.preventDefault()` rather than `e.stopPropagation()`. stopPropagation only stops it bubbling up to higher DOM nodes, it doesn't prevent the default action.
This works for me. ``` $("input[type='text']").on('keypress', function(e) { return e.keyCode != 13; }); ```
10,090
Playing 8 handed 1/2 nlhe at a table with a couple LAG fish, 3 tight passive, myself playing TAG but I get a bit loose from cutoff to button. Lots of limpers every hand. I never limp, I raise or I don’t play. In the cutoff I get A10s (hearts). Good enough, but barely. I raise to 12 with 2 limpers and the blinds in fr...
2018/08/31
[ "https://poker.stackexchange.com/questions/10090", "https://poker.stackexchange.com", "https://poker.stackexchange.com/users/6311/" ]
Against players that play anything from any position, the easy answer is that you can not put them on a hand. If they are taking lines that are unusual and they play any hand in any position, putting them on a hand would be challenging if not impossible. I think you did the right thing by trying to get a live read, t...
Ok ok, this is literally a secret I learned form a whole year of surviving on poker before I got a job. This makes the difference between breaking even and winning and it's such a delicate change too... Identify the play BEFORE you have to make it. If you saw her reraising you preflop, you need to gather data and thin...
10,090
Playing 8 handed 1/2 nlhe at a table with a couple LAG fish, 3 tight passive, myself playing TAG but I get a bit loose from cutoff to button. Lots of limpers every hand. I never limp, I raise or I don’t play. In the cutoff I get A10s (hearts). Good enough, but barely. I raise to 12 with 2 limpers and the blinds in fr...
2018/08/31
[ "https://poker.stackexchange.com/questions/10090", "https://poker.stackexchange.com", "https://poker.stackexchange.com/users/6311/" ]
Against players that play anything from any position, the easy answer is that you can not put them on a hand. If they are taking lines that are unusual and they play any hand in any position, putting them on a hand would be challenging if not impossible. I think you did the right thing by trying to get a live read, t...
Not agreeing with your analysis of cannot put her on a monster because she only called the big blind pre-flop. She 3 bet your raise. That is a sign of strength. Check raise the flop is a sign of strength. Getting 8:1 you have to call with top pair in that spot. When a table is loose play tight.
10,888
Is there some way to tell who has created which tags, and when? If a method doesn't exist I would petition SO to add this, as I would very much enjoy seeing tags I created being used by other people. SO must track creator meta-data on tags since a badge is awarded for creating a tag used by 50+ questions (taxidermist...
2009/07/29
[ "https://meta.stackexchange.com/questions/10888", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/132467/" ]
There is nothing in your user page that will help with this, but following the chain below you might be able to figure out if you asked the first question with a specific tag. However, I'm not sure how retagging and/or deleted questions are treated in relation to the taxonomist badge. `Tag -> sort by newest -> last pa...
One does not.... Maybe the data dumps... But this is not visible at this time as far as I know...
10,888
Is there some way to tell who has created which tags, and when? If a method doesn't exist I would petition SO to add this, as I would very much enjoy seeing tags I created being used by other people. SO must track creator meta-data on tags since a badge is awarded for creating a tag used by 50+ questions (taxidermist...
2009/07/29
[ "https://meta.stackexchange.com/questions/10888", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/132467/" ]
One does not.... Maybe the data dumps... But this is not visible at this time as far as I know...
This is now covered by the **Taxonomist** badge. To see a list of all those with the badge and what tag they created (so long as it is still in use), check out the [Taxonomist](https://webmasters.stackexchange.com/badges/11/taxonomist "putting tags in your skin so you can eat while you freak") badge page. To see what...
10,888
Is there some way to tell who has created which tags, and when? If a method doesn't exist I would petition SO to add this, as I would very much enjoy seeing tags I created being used by other people. SO must track creator meta-data on tags since a badge is awarded for creating a tag used by 50+ questions (taxidermist...
2009/07/29
[ "https://meta.stackexchange.com/questions/10888", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/132467/" ]
There is nothing in your user page that will help with this, but following the chain below you might be able to figure out if you asked the first question with a specific tag. However, I'm not sure how retagging and/or deleted questions are treated in relation to the taxonomist badge. `Tag -> sort by newest -> last pa...
I have a list of which users created which tags, but Jeff has said he doesn't think any good can come from disclosing this information. I may be persuaded to help you if it's regarding a specific tag or user, but I won't help you if the tag has less than 50 occurrences. In the general case nothing from SO will help y...
10,888
Is there some way to tell who has created which tags, and when? If a method doesn't exist I would petition SO to add this, as I would very much enjoy seeing tags I created being used by other people. SO must track creator meta-data on tags since a badge is awarded for creating a tag used by 50+ questions (taxidermist...
2009/07/29
[ "https://meta.stackexchange.com/questions/10888", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/132467/" ]
There is nothing in your user page that will help with this, but following the chain below you might be able to figure out if you asked the first question with a specific tag. However, I'm not sure how retagging and/or deleted questions are treated in relation to the taxonomist badge. `Tag -> sort by newest -> last pa...
This is now covered by the **Taxonomist** badge. To see a list of all those with the badge and what tag they created (so long as it is still in use), check out the [Taxonomist](https://webmasters.stackexchange.com/badges/11/taxonomist "putting tags in your skin so you can eat while you freak") badge page. To see what...
10,888
Is there some way to tell who has created which tags, and when? If a method doesn't exist I would petition SO to add this, as I would very much enjoy seeing tags I created being used by other people. SO must track creator meta-data on tags since a badge is awarded for creating a tag used by 50+ questions (taxidermist...
2009/07/29
[ "https://meta.stackexchange.com/questions/10888", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/132467/" ]
I have a list of which users created which tags, but Jeff has said he doesn't think any good can come from disclosing this information. I may be persuaded to help you if it's regarding a specific tag or user, but I won't help you if the tag has less than 50 occurrences. In the general case nothing from SO will help y...
This is now covered by the **Taxonomist** badge. To see a list of all those with the badge and what tag they created (so long as it is still in use), check out the [Taxonomist](https://webmasters.stackexchange.com/badges/11/taxonomist "putting tags in your skin so you can eat while you freak") badge page. To see what...
2,700,848
Consider the following sequence, where the two consecutive terms are positive and the next two are negative, and so on: $$ a\_n = 1 , 1, -1 , -1 , 1 , 1 , -1 , -1 , 1 ...$$ I've managed to think up some way of writing the sequence: $$a\_n = (-1)^\left \lfloor{\frac{n}{2}}\right \rfloor$$ $$ a\_n = \sqrt2 \cdot\frac...
2018/03/20
[ "https://math.stackexchange.com/questions/2700848", "https://math.stackexchange.com", "https://math.stackexchange.com/users/493831/" ]
**Hint**. Try this $$ (-1)^{\large \frac{n(n-1)}2},\qquad n=0,1,2,3,\cdots. $$
$$a\_n=\begin{cases} 1 & \text{ if } n=4k+1 or \text{ } n= 4k+2;\\-1 & \text{ otherwise}\end{cases}$$
2,700,848
Consider the following sequence, where the two consecutive terms are positive and the next two are negative, and so on: $$ a\_n = 1 , 1, -1 , -1 , 1 , 1 , -1 , -1 , 1 ...$$ I've managed to think up some way of writing the sequence: $$a\_n = (-1)^\left \lfloor{\frac{n}{2}}\right \rfloor$$ $$ a\_n = \sqrt2 \cdot\frac...
2018/03/20
[ "https://math.stackexchange.com/questions/2700848", "https://math.stackexchange.com", "https://math.stackexchange.com/users/493831/" ]
**Hint**. Try this $$ (-1)^{\large \frac{n(n-1)}2},\qquad n=0,1,2,3,\cdots. $$
Note that this sequence is periodic with period $4$. A similar procedure may be conducted with any periodic sequence. Index the sequence from $0$. Then the sequence is the solution of the recurrence relation $$ a\_n=a\_{n-4};\quad (a\_0=1,a\_1=1,a\_2=-1,a\_3=-1) $$ This recurrence relation has characteristic equation $...
2,700,848
Consider the following sequence, where the two consecutive terms are positive and the next two are negative, and so on: $$ a\_n = 1 , 1, -1 , -1 , 1 , 1 , -1 , -1 , 1 ...$$ I've managed to think up some way of writing the sequence: $$a\_n = (-1)^\left \lfloor{\frac{n}{2}}\right \rfloor$$ $$ a\_n = \sqrt2 \cdot\frac...
2018/03/20
[ "https://math.stackexchange.com/questions/2700848", "https://math.stackexchange.com", "https://math.stackexchange.com/users/493831/" ]
**Hint**. Try this $$ (-1)^{\large \frac{n(n-1)}2},\qquad n=0,1,2,3,\cdots. $$
A trig version using that sin, cos of $(\pi/2)n$ are $\pm 1$ of period $4$ is $$a\_n=\sin \frac{\pi}{2}n - \cos \frac{\pi}{2}n.$$ [from the periodicity it only needs checking for $n=1,2,3,4.$]
63,123
As of today, Turkey appears to have withdrawn from the [Istanbul Convention](https://en.wikipedia.org/wiki/Istanbul_Convention), an effort by the Council of Europe to create a standard legal approach to battling violence against women and domestic abuse. > > On 20 March 2021, Turkey has announced its withdrawal from ...
2021/03/20
[ "https://politics.stackexchange.com/questions/63123", "https://politics.stackexchange.com", "https://politics.stackexchange.com/users/15563/" ]
Erdogan is [quoted](https://web.archive.org/web/20210321183529/https://www.independent.co.uk/news/world/americas/us-politics/biden-calls-turkeys-exit-from-treaty-for-women-unwarranted-turkey-joe-biden-recep-tayyip-erdogan-istanbul-white-house-b1820290.html) as saying > > "the Istanbul Convention, originally intended ...
BBC's comment has part of truth in it: "Turkish conservatives argue its principles of gender equality and non-discrimination on grounds of sexual orientation undermine family values and promote homosexuality." However, the reason of timing is different. This tolerance was highly abused by women, and false rape and do...
48,234,689
`private int mShuffleMode = SharedPreferences.getInt("shufflemode");` Tells me that a Non-static method can't be referenced from a static context. I'm not entirely sure what this means. What I'm trying to do is initialise the variable with the preference that was set before.
2018/01/12
[ "https://Stackoverflow.com/questions/48234689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4371415/" ]
Try removing the Angular CLI and reinstalling it again: ``` $ npm uninstall @angular/cli $ npm cache clean $ npm install -g @angular/cli@latest ``` To ensure you have the latest version. IF the problem persists, try updating the Node version (6.11.4 is a bit old). You can use nvm to update your node version. Down...
below command working for me. ``` CMD : npm install @angular-devkit/schematics@0.0.45 @angular/cli --no-save ```
48,234,689
`private int mShuffleMode = SharedPreferences.getInt("shufflemode");` Tells me that a Non-static method can't be referenced from a static context. I'm not entirely sure what this means. What I'm trying to do is initialise the variable with the preference that was set before.
2018/01/12
[ "https://Stackoverflow.com/questions/48234689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4371415/" ]
Here is the link to git issue: <https://github.com/angular/devkit/issues/380> Solution (temporary solution until they fix the issue): Adding the following lines to the package.json fixes the problems ``` "@angular-devkit/schematics":"0.0.42", "@angular-devkit/core": "0.0.23", ``` To create new project run the fol...
below command working for me. ``` CMD : npm install @angular-devkit/schematics@0.0.45 @angular/cli --no-save ```
48,234,689
`private int mShuffleMode = SharedPreferences.getInt("shufflemode");` Tells me that a Non-static method can't be referenced from a static context. I'm not entirely sure what this means. What I'm trying to do is initialise the variable with the preference that was set before.
2018/01/12
[ "https://Stackoverflow.com/questions/48234689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4371415/" ]
Here is the link to git issue: <https://github.com/angular/devkit/issues/380> Solution (temporary solution until they fix the issue): Adding the following lines to the package.json fixes the problems ``` "@angular-devkit/schematics":"0.0.42", "@angular-devkit/core": "0.0.23", ``` To create new project run the fol...
I made the following changes installing this packages: ``` "@angular-devkit/build-optimizer": "0.0.36", "@angular-devkit/core": "0.0.22", "@angular-devkit/schematics": "0.0.42", "@schematics/angular": "^0.1.11", "@schematics/schematics": "0.0.11" ``` And it works now [My Configuration](https://i.stack.imgur.com/lPx...
48,234,689
`private int mShuffleMode = SharedPreferences.getInt("shufflemode");` Tells me that a Non-static method can't be referenced from a static context. I'm not entirely sure what this means. What I'm trying to do is initialise the variable with the preference that was set before.
2018/01/12
[ "https://Stackoverflow.com/questions/48234689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4371415/" ]
Try removing the Angular CLI and reinstalling it again: ``` $ npm uninstall @angular/cli $ npm cache clean $ npm install -g @angular/cli@latest ``` To ensure you have the latest version. IF the problem persists, try updating the Node version (6.11.4 is a bit old). You can use nvm to update your node version. Down...
I made the following changes installing this packages: ``` "@angular-devkit/build-optimizer": "0.0.36", "@angular-devkit/core": "0.0.22", "@angular-devkit/schematics": "0.0.42", "@schematics/angular": "^0.1.11", "@schematics/schematics": "0.0.11" ``` And it works now [My Configuration](https://i.stack.imgur.com/lPx...
48,234,689
`private int mShuffleMode = SharedPreferences.getInt("shufflemode");` Tells me that a Non-static method can't be referenced from a static context. I'm not entirely sure what this means. What I'm trying to do is initialise the variable with the preference that was set before.
2018/01/12
[ "https://Stackoverflow.com/questions/48234689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4371415/" ]
Here is the link to git issue: <https://github.com/angular/devkit/issues/380> Solution (temporary solution until they fix the issue): Adding the following lines to the package.json fixes the problems ``` "@angular-devkit/schematics":"0.0.42", "@angular-devkit/core": "0.0.23", ``` To create new project run the fol...
I had same problem here, just fixed with @angular/cli 1.6.5 ``` $ npm uninstall @angular/cli $ npm cache clean $ npm install -g @angular/cli@latest ``` And in my project folder: ``` $ rm -rf node_modules dist $ npm install --save-dev @angular/cli@latest $ npm install ``` Now I can generate projects, components, e...
48,234,689
`private int mShuffleMode = SharedPreferences.getInt("shufflemode");` Tells me that a Non-static method can't be referenced from a static context. I'm not entirely sure what this means. What I'm trying to do is initialise the variable with the preference that was set before.
2018/01/12
[ "https://Stackoverflow.com/questions/48234689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4371415/" ]
> > **Status** > > > This issue has been resolved in version 1.6.6. > > > **Updating** > > > The steps to update your environment to the latest version containing > the fix: > > > > ``` > npm uninstall -g @angular/cli > npm cache clean > # if npm version is > 5 then use `npm cache verify` to avoid errors (...
I made the following changes installing this packages: ``` "@angular-devkit/build-optimizer": "0.0.36", "@angular-devkit/core": "0.0.22", "@angular-devkit/schematics": "0.0.42", "@schematics/angular": "^0.1.11", "@schematics/schematics": "0.0.11" ``` And it works now [My Configuration](https://i.stack.imgur.com/lPx...
48,234,689
`private int mShuffleMode = SharedPreferences.getInt("shufflemode");` Tells me that a Non-static method can't be referenced from a static context. I'm not entirely sure what this means. What I'm trying to do is initialise the variable with the preference that was set before.
2018/01/12
[ "https://Stackoverflow.com/questions/48234689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4371415/" ]
I had same problem here, just fixed with @angular/cli 1.6.5 ``` $ npm uninstall @angular/cli $ npm cache clean $ npm install -g @angular/cli@latest ``` And in my project folder: ``` $ rm -rf node_modules dist $ npm install --save-dev @angular/cli@latest $ npm install ``` Now I can generate projects, components, e...
below command working for me. ``` CMD : npm install @angular-devkit/schematics@0.0.45 @angular/cli --no-save ```
48,234,689
`private int mShuffleMode = SharedPreferences.getInt("shufflemode");` Tells me that a Non-static method can't be referenced from a static context. I'm not entirely sure what this means. What I'm trying to do is initialise the variable with the preference that was set before.
2018/01/12
[ "https://Stackoverflow.com/questions/48234689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4371415/" ]
Here is the link to git issue: <https://github.com/angular/devkit/issues/380> Solution (temporary solution until they fix the issue): Adding the following lines to the package.json fixes the problems ``` "@angular-devkit/schematics":"0.0.42", "@angular-devkit/core": "0.0.23", ``` To create new project run the fol...
> > **Status** > > > This issue has been resolved in version 1.6.6. > > > **Updating** > > > The steps to update your environment to the latest version containing > the fix: > > > > ``` > npm uninstall -g @angular/cli > npm cache clean > # if npm version is > 5 then use `npm cache verify` to avoid errors (...
48,234,689
`private int mShuffleMode = SharedPreferences.getInt("shufflemode");` Tells me that a Non-static method can't be referenced from a static context. I'm not entirely sure what this means. What I'm trying to do is initialise the variable with the preference that was set before.
2018/01/12
[ "https://Stackoverflow.com/questions/48234689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4371415/" ]
Here is the link to git issue: <https://github.com/angular/devkit/issues/380> Solution (temporary solution until they fix the issue): Adding the following lines to the package.json fixes the problems ``` "@angular-devkit/schematics":"0.0.42", "@angular-devkit/core": "0.0.23", ``` To create new project run the fol...
Try removing the Angular CLI and reinstalling it again: ``` $ npm uninstall @angular/cli $ npm cache clean $ npm install -g @angular/cli@latest ``` To ensure you have the latest version. IF the problem persists, try updating the Node version (6.11.4 is a bit old). You can use nvm to update your node version. Down...
48,234,689
`private int mShuffleMode = SharedPreferences.getInt("shufflemode");` Tells me that a Non-static method can't be referenced from a static context. I'm not entirely sure what this means. What I'm trying to do is initialise the variable with the preference that was set before.
2018/01/12
[ "https://Stackoverflow.com/questions/48234689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4371415/" ]
below command working for me. ``` CMD : npm install @angular-devkit/schematics@0.0.45 @angular/cli --no-save ```
On angular/cli 1.6.4 I was getting "Error: dryRunSink.commit(...).ignoreElements is not a function" The newest version has it fixed on @angular/cli: 1.6.5, you can check it out by installing it by running the following: ``` npm uninstall @angular/cli npm install -g @angular/cli@latest ``` be sure to install the dev...
69,495,886
How do you enable emmet for nextjs ( js file)?
2021/10/08
[ "https://Stackoverflow.com/questions/69495886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17106617/" ]
Emmets don't work in JS files. However, you can set it so that VS Code thinks that it's a JSX file and it would give React IntelliSense. 1. Click the button written "JavaScript" in the Status Bar, which should be at the bottom. [![enter image description here](https://i.stack.imgur.com/jUppw.png)](https://i.stack.img...
You can change the file extension from '.js' to '.jsx'
38,177,183
I'm bundling a typescript project, and webpack fails with the error `ERROR in (webpack)/lib/NormalModule.js Module not found: Error: Can't resolve 'module' in 'C:\SPA\MyApp\node_modules\webpack\lib' @ (webpack)/lib/NormalModule.js 91:16-33` If I hack the module from `var Module = require("module");` to `var Module ...
2016/07/04
[ "https://Stackoverflow.com/questions/38177183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/784699/" ]
For a beginner the following would be enough. ``` ├── Gemfile ├── Gemfile.lock ├── app.rb ├── config.rb └── lib/ ├── lib1.rb ├── lib2.rb ``` where app.rb is you main file and you run the project using ruby app.rb lib/ has you library files lib1.rb and lib2.rb suppose you are tweeting through your app then...
I recommend using **Hoe**: <https://github.com/seattlerb/hoe> > > Hoe focuses on keeping everything in its place in a useful form and > intelligently extracting what it needs. As a result, there are no > extra YAML files, config directories, ruby files, or any other > artifacts in your release that you wouldn't al...
38,177,183
I'm bundling a typescript project, and webpack fails with the error `ERROR in (webpack)/lib/NormalModule.js Module not found: Error: Can't resolve 'module' in 'C:\SPA\MyApp\node_modules\webpack\lib' @ (webpack)/lib/NormalModule.js 91:16-33` If I hack the module from `var Module = require("module");` to `var Module ...
2016/07/04
[ "https://Stackoverflow.com/questions/38177183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/784699/" ]
For a beginner the following would be enough. ``` ├── Gemfile ├── Gemfile.lock ├── app.rb ├── config.rb └── lib/ ├── lib1.rb ├── lib2.rb ``` where app.rb is you main file and you run the project using ruby app.rb lib/ has you library files lib1.rb and lib2.rb suppose you are tweeting through your app then...
"It uses constants and global variables." Oh, no, please, don't do this. You're making your life needlessly difficult. You really need to avoid using global constants and variables unless you literally have no other option. They're extremely difficult to keep orderly and tend to cause chaos in any non-trivial program....
83,775
I have the current situation: in iPhoto, I can see some of my pictures made in the last months ONLY in Photostream. iPhoto says they're imported already, but "show in Library" leads to nowhere. Since Photostream has a 1000 pictures limit, I'm afraid I'll soon lose some photos I really like. Last import is supposed to...
2013/02/28
[ "https://apple.stackexchange.com/questions/83775", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/10111/" ]
You must press `command` + `option` while dragging.
Hold down `cmd` and `option` when dragging.
179,183
What to do when a sprint is finished early? At the moment our Scrum team works off stories from the backlog, if the sprint is finished early. What happens with stories taken from the backlog? Will the stories be added to the current Sprint ? If yes, what if these stories won't be finished in time. Is the Sprint faile...
2012/12/12
[ "https://softwareengineering.stackexchange.com/questions/179183", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/62059/" ]
I'd encourage slack to be used for personal improvement. Sure, pull in stories from the backlog, but make sure you spend some time on yourselves: learn a new language, practice your craft with a kata, refactor some stuff, tweak, refine or write new tools to help you out, go and talk to a stakeholder, colleague or clien...
Thought I would expand upon some of the other answers here. Personally I think that adding to an active sprint is a very bad idea. Scrum is all about the team committing to finish a scope of work that is set in stone. The team commits to that work in the planning before the sprint begins. During the sprint, the team...
179,183
What to do when a sprint is finished early? At the moment our Scrum team works off stories from the backlog, if the sprint is finished early. What happens with stories taken from the backlog? Will the stories be added to the current Sprint ? If yes, what if these stories won't be finished in time. Is the Sprint faile...
2012/12/12
[ "https://softwareengineering.stackexchange.com/questions/179183", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/62059/" ]
Bring something from the project backlog into the sprint (after discussions with scrum master and project owner). The size of the item you undertake will depend on how much time you have. If there is nothing small enough create a sub-task of a bigger task to get it started (ie do some of the preliminary work). Altern...
Thought I would expand upon some of the other answers here. Personally I think that adding to an active sprint is a very bad idea. Scrum is all about the team committing to finish a scope of work that is set in stone. The team commits to that work in the planning before the sprint begins. During the sprint, the team...
179,183
What to do when a sprint is finished early? At the moment our Scrum team works off stories from the backlog, if the sprint is finished early. What happens with stories taken from the backlog? Will the stories be added to the current Sprint ? If yes, what if these stories won't be finished in time. Is the Sprint faile...
2012/12/12
[ "https://softwareengineering.stackexchange.com/questions/179183", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/62059/" ]
Sprints do not address products but periods. If a sprint lasts two weeks, it cannot finish earlier. If the products planned for the sprint have been finished in advance (I think your question goes in such direction), nice. But that doesn't mean that the sprint is finished. Get your backlog and follow on. In fact, a ...
Thought I would expand upon some of the other answers here. Personally I think that adding to an active sprint is a very bad idea. Scrum is all about the team committing to finish a scope of work that is set in stone. The team commits to that work in the planning before the sprint begins. During the sprint, the team...
179,183
What to do when a sprint is finished early? At the moment our Scrum team works off stories from the backlog, if the sprint is finished early. What happens with stories taken from the backlog? Will the stories be added to the current Sprint ? If yes, what if these stories won't be finished in time. Is the Sprint faile...
2012/12/12
[ "https://softwareengineering.stackexchange.com/questions/179183", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/62059/" ]
Bring something from the project backlog into the sprint (after discussions with scrum master and project owner). The size of the item you undertake will depend on how much time you have. If there is nothing small enough create a sub-task of a bigger task to get it started (ie do some of the preliminary work). Altern...
I'd encourage slack to be used for personal improvement. Sure, pull in stories from the backlog, but make sure you spend some time on yourselves: learn a new language, practice your craft with a kata, refactor some stuff, tweak, refine or write new tools to help you out, go and talk to a stakeholder, colleague or clien...
179,183
What to do when a sprint is finished early? At the moment our Scrum team works off stories from the backlog, if the sprint is finished early. What happens with stories taken from the backlog? Will the stories be added to the current Sprint ? If yes, what if these stories won't be finished in time. Is the Sprint faile...
2012/12/12
[ "https://softwareengineering.stackexchange.com/questions/179183", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/62059/" ]
Bring something from the project backlog into the sprint (after discussions with scrum master and project owner). The size of the item you undertake will depend on how much time you have. If there is nothing small enough create a sub-task of a bigger task to get it started (ie do some of the preliminary work). Altern...
Working on stretch or future sprint backlog items seems to be the common thing to do, which makes a lot of sense if your sprint backlog items are small enough and clearly defined. However, backlog items that may place the "done" code into a "no longer done" state should be avoided. If the sprint is truly finished, tag...
179,183
What to do when a sprint is finished early? At the moment our Scrum team works off stories from the backlog, if the sprint is finished early. What happens with stories taken from the backlog? Will the stories be added to the current Sprint ? If yes, what if these stories won't be finished in time. Is the Sprint faile...
2012/12/12
[ "https://softwareengineering.stackexchange.com/questions/179183", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/62059/" ]
What my team does is pull tasks in from the backlog that are reasonably small enough to complete with respect to how early we finished. If we're done with *that*, we give our QA team time to catch up with their testing, and the developers get a "free day" - we can use this to look into other issues not related to the c...
Thought I would expand upon some of the other answers here. Personally I think that adding to an active sprint is a very bad idea. Scrum is all about the team committing to finish a scope of work that is set in stone. The team commits to that work in the planning before the sprint begins. During the sprint, the team...
179,183
What to do when a sprint is finished early? At the moment our Scrum team works off stories from the backlog, if the sprint is finished early. What happens with stories taken from the backlog? Will the stories be added to the current Sprint ? If yes, what if these stories won't be finished in time. Is the Sprint faile...
2012/12/12
[ "https://softwareengineering.stackexchange.com/questions/179183", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/62059/" ]
I'd encourage slack to be used for personal improvement. Sure, pull in stories from the backlog, but make sure you spend some time on yourselves: learn a new language, practice your craft with a kata, refactor some stuff, tweak, refine or write new tools to help you out, go and talk to a stakeholder, colleague or clien...
Sprints do not address products but periods. If a sprint lasts two weeks, it cannot finish earlier. If the products planned for the sprint have been finished in advance (I think your question goes in such direction), nice. But that doesn't mean that the sprint is finished. Get your backlog and follow on. In fact, a ...
179,183
What to do when a sprint is finished early? At the moment our Scrum team works off stories from the backlog, if the sprint is finished early. What happens with stories taken from the backlog? Will the stories be added to the current Sprint ? If yes, what if these stories won't be finished in time. Is the Sprint faile...
2012/12/12
[ "https://softwareengineering.stackexchange.com/questions/179183", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/62059/" ]
Working on stretch or future sprint backlog items seems to be the common thing to do, which makes a lot of sense if your sprint backlog items are small enough and clearly defined. However, backlog items that may place the "done" code into a "no longer done" state should be avoided. If the sprint is truly finished, tag...
I'd encourage slack to be used for personal improvement. Sure, pull in stories from the backlog, but make sure you spend some time on yourselves: learn a new language, practice your craft with a kata, refactor some stuff, tweak, refine or write new tools to help you out, go and talk to a stakeholder, colleague or clien...
179,183
What to do when a sprint is finished early? At the moment our Scrum team works off stories from the backlog, if the sprint is finished early. What happens with stories taken from the backlog? Will the stories be added to the current Sprint ? If yes, what if these stories won't be finished in time. Is the Sprint faile...
2012/12/12
[ "https://softwareengineering.stackexchange.com/questions/179183", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/62059/" ]
Bring something from the project backlog into the sprint (after discussions with scrum master and project owner). The size of the item you undertake will depend on how much time you have. If there is nothing small enough create a sub-task of a bigger task to get it started (ie do some of the preliminary work). Altern...
For us a Sprint never ends early. We only increased our velocity or solved the problem in a way that makes us get more work done in the sprint. Saying that we always have a backlog of items that are prioritized in order of importance by our product owners. When any team can fit more work into the sprint it is very ea...
179,183
What to do when a sprint is finished early? At the moment our Scrum team works off stories from the backlog, if the sprint is finished early. What happens with stories taken from the backlog? Will the stories be added to the current Sprint ? If yes, what if these stories won't be finished in time. Is the Sprint faile...
2012/12/12
[ "https://softwareengineering.stackexchange.com/questions/179183", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/62059/" ]
Bring something from the project backlog into the sprint (after discussions with scrum master and project owner). The size of the item you undertake will depend on how much time you have. If there is nothing small enough create a sub-task of a bigger task to get it started (ie do some of the preliminary work). Altern...
What my team does is pull tasks in from the backlog that are reasonably small enough to complete with respect to how early we finished. If we're done with *that*, we give our QA team time to catch up with their testing, and the developers get a "free day" - we can use this to look into other issues not related to the c...
23,607,852
I have a requirement in office online 365 in which following things are needed. 1. Calendar list with custom field "Events", type is choice (General,Marriage,Birthday) 2. Need to create a dropdown in which above field's value should bind. 3. When user select "General" then only General events should display, birthday ...
2014/05/12
[ "https://Stackoverflow.com/questions/23607852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3506098/" ]
AFAIK, VC++ doesn't have a commandline flag to let you specify a UTF-8 execution character set. However it does (sporadically) support the undocumented ``` #pragma execution_character_set("utf-8") ``` referred to [here](http://connect.microsoft.com/VisualStudio/feedback/details/773186/pragma-execution-character-set...
It should be noted that the pragma `execution_character_set` does only seem to apply to character string literals (`"Hello World"`) and not wide character string literals (`L"Hello World"`). I did some experiments to find out how source and execution character sets are implemented in MSVC. I did the experiments with V...
23,607,852
I have a requirement in office online 365 in which following things are needed. 1. Calendar list with custom field "Events", type is choice (General,Marriage,Birthday) 2. Need to create a dropdown in which above field's value should bind. 3. When user select "General" then only General events should display, birthday ...
2014/05/12
[ "https://Stackoverflow.com/questions/23607852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3506098/" ]
AFAIK, VC++ doesn't have a commandline flag to let you specify a UTF-8 execution character set. However it does (sporadically) support the undocumented ``` #pragma execution_character_set("utf-8") ``` referred to [here](http://connect.microsoft.com/VisualStudio/feedback/details/773186/pragma-execution-character-set...
The Visual Studio 2015 Update 2 and later [supports setting the *execution character set*](https://blogs.msdn.microsoft.com/vcblog/2016/02/22/new-options-for-managing-character-sets-in-the-microsoft-cc-compiler/): You can use the option `/utf-8` which combines the options `/source-charset:utf-8` and `/execution-charse...
23,607,852
I have a requirement in office online 365 in which following things are needed. 1. Calendar list with custom field "Events", type is choice (General,Marriage,Birthday) 2. Need to create a dropdown in which above field's value should bind. 3. When user select "General" then only General events should display, birthday ...
2014/05/12
[ "https://Stackoverflow.com/questions/23607852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3506098/" ]
AFAIK, VC++ doesn't have a commandline flag to let you specify a UTF-8 execution character set. However it does (sporadically) support the undocumented ``` #pragma execution_character_set("utf-8") ``` referred to [here](http://connect.microsoft.com/VisualStudio/feedback/details/773186/pragma-execution-character-set...
Credit on @user3998276 's answer and the great experiment. The conclusion tells me a lot * when meet L"string", wide string: + compiler first detects the cpp-file-encoding, then: - Unicode--> just use utf-16 // may here also has a conversion, like u8 to u16. - ACP--> convert the Unicode string to ACP * when mee...
23,607,852
I have a requirement in office online 365 in which following things are needed. 1. Calendar list with custom field "Events", type is choice (General,Marriage,Birthday) 2. Need to create a dropdown in which above field's value should bind. 3. When user select "General" then only General events should display, birthday ...
2014/05/12
[ "https://Stackoverflow.com/questions/23607852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3506098/" ]
It should be noted that the pragma `execution_character_set` does only seem to apply to character string literals (`"Hello World"`) and not wide character string literals (`L"Hello World"`). I did some experiments to find out how source and execution character sets are implemented in MSVC. I did the experiments with V...
Credit on @user3998276 's answer and the great experiment. The conclusion tells me a lot * when meet L"string", wide string: + compiler first detects the cpp-file-encoding, then: - Unicode--> just use utf-16 // may here also has a conversion, like u8 to u16. - ACP--> convert the Unicode string to ACP * when mee...
23,607,852
I have a requirement in office online 365 in which following things are needed. 1. Calendar list with custom field "Events", type is choice (General,Marriage,Birthday) 2. Need to create a dropdown in which above field's value should bind. 3. When user select "General" then only General events should display, birthday ...
2014/05/12
[ "https://Stackoverflow.com/questions/23607852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3506098/" ]
The Visual Studio 2015 Update 2 and later [supports setting the *execution character set*](https://blogs.msdn.microsoft.com/vcblog/2016/02/22/new-options-for-managing-character-sets-in-the-microsoft-cc-compiler/): You can use the option `/utf-8` which combines the options `/source-charset:utf-8` and `/execution-charse...
Credit on @user3998276 's answer and the great experiment. The conclusion tells me a lot * when meet L"string", wide string: + compiler first detects the cpp-file-encoding, then: - Unicode--> just use utf-16 // may here also has a conversion, like u8 to u16. - ACP--> convert the Unicode string to ACP * when mee...
9,055,809
I am trying to put 3 divs (lets call them div1, div2 and div3) into one container div with 700px width. What I want to manage is that the content of the div1 is higher in the source code, but is visible lower at the webpage (please see attached picture). ``` <div id="container"> <div id="div1">content of the div1</di...
2012/01/29
[ "https://Stackoverflow.com/questions/9055809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1172238/" ]
I've tried to find a few walkarounds for what you are trying to do. But this is not possible considering what you are trying to do. Something of the sort would be doable if you were willing to set fixed heights to your elements. This is my reasoning : If you are going to leave the positionning relative, this means t...
Try this code using the `float` element. ``` <div style="width: 704px; padding: 10px;"> <div style="border: 1px solid red; height: 200px;width: 500px; float: left"></div> <div style="border: 1px solid blue; height: 200px;width: 200px;float: right;"></div> <br /> <div style="border: 1px solid green; he...
40,965,798
This is the HTML that my Bootstrap Tour is working on: ``` <body class="top-navigation"> <div id="wrapper"> <div id="page-wrapper"> <div class="row border-bottom"> <nav class="navbar navbar-static-top"> <div class="navbar-header"> <a href="/"> <im...
2016/12/05
[ "https://Stackoverflow.com/questions/40965798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91970/" ]
According to [AttributeError while trying to load the pickled matplotlib figure](https://stackoverflow.com/questions/49503869/attributeerror-while-trying-to-load-the-pickled-matplotlib-figure), a simple workaround is: ``` fig = plt.Figure(...) ...... managed_fig = plt.figure(...) canvas_manager = managed_fig.canvas.ma...
I usually use matplotlib's pyplot for immediate generation (or produce images in jupyter notebooks). This would look like the following: ``` import matplotlib.pyplot as plt figure = plt.figure(figsize=(10, 5), dpi=dpi) plt.show() ``` This shows the (blank) figure as desired.
27,541,918
Hi guys am getting following error am using Websocket and Tomcat8. ``` java.lang.IllegalStateException: The remote endpoint was in state [TEXT_FULL_WRITING] which is an invalid state for called method at org.apache.tomcat.websocket.WsRemoteEndpointImplBase$StateMachine.checkState(WsRemoteEndpointImplBase.java:109...
2014/12/18
[ "https://Stackoverflow.com/questions/27541918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4373356/" ]
You are trying to write to a websocket that is not in a ready state. The websocket is currently in writing mode and you are trying to write another message to that websocket which raises an error. Using an `async` write or as not such good practice a `sleep` can prevent this from happening. This error is also normally ...
Neither async or sleep can help. The key problem is the send-method can not be called concurrently. So it's just about concurrency, you can use locks or some other thing. Here is how I handle it. In fact, I write a actor to wrap the socketSession. It will produce an event when the send-method is called. Each actor w...
27,541,918
Hi guys am getting following error am using Websocket and Tomcat8. ``` java.lang.IllegalStateException: The remote endpoint was in state [TEXT_FULL_WRITING] which is an invalid state for called method at org.apache.tomcat.websocket.WsRemoteEndpointImplBase$StateMachine.checkState(WsRemoteEndpointImplBase.java:109...
2014/12/18
[ "https://Stackoverflow.com/questions/27541918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4373356/" ]
You are trying to write to a websocket that is not in a ready state. The websocket is currently in writing mode and you are trying to write another message to that websocket which raises an error. Using an `async` write or as not such good practice a `sleep` can prevent this from happening. This error is also normally ...
it is actually not a concurrency issue, you will have the same error in a single-threaded environment. It is about asynchronous calls that must not overlap. You should use `session.get**Basic**Remote().sendText` instead of `session.get**Async**Remote().sendText()` to avoid this problem. Should not be an issue as long ...
48,152,894
Is it possible to address a mailmessage to a 'name' instead of an 'e-mailaddress'. Something like this: ``` MailMessage mmsg = new MailMessage(); mmsg.To.Add("Winfrey"); ``` instead of: ``` MailMessage mmsg = new MailMessage(); mmsg.To.Add(new MailAddress("Winfrey@user.com")); ``` Is it possible to add somethin...
2018/01/08
[ "https://Stackoverflow.com/questions/48152894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7831371/" ]
The MailMessage class does not provide this. From where should this class know, which mail address is behind 'Winfrey'? The only way is to create a simple address book. Then you can write this ``` mmsg.To.Add(_addressBook["Winfrey"]); ``` *\_addressBook* is a Dictionary here. ``` Dictionary<string, string> _add...
If you are looking to see the sender's name on the e-mail that the other user receives: ``` MailMessage mail = new MailMessage(); mail.From = new MailAddress("winfrey@user.com", "winfrey" ); ``` It'll display the name Winfrey.
48,152,894
Is it possible to address a mailmessage to a 'name' instead of an 'e-mailaddress'. Something like this: ``` MailMessage mmsg = new MailMessage(); mmsg.To.Add("Winfrey"); ``` instead of: ``` MailMessage mmsg = new MailMessage(); mmsg.To.Add(new MailAddress("Winfrey@user.com")); ``` Is it possible to add somethin...
2018/01/08
[ "https://Stackoverflow.com/questions/48152894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7831371/" ]
The MailMessage class does not provide this. From where should this class know, which mail address is behind 'Winfrey'? The only way is to create a simple address book. Then you can write this ``` mmsg.To.Add(_addressBook["Winfrey"]); ``` *\_addressBook* is a Dictionary here. ``` Dictionary<string, string> _add...
`System.Net.Mail` doesn't validate the email that you are sending to. `MailMessage.To` only accepts email address. [See this!](https://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.to(v=vs.110).aspx?cs-save-lang=1&cs-lang=cpp#code-snippet-2)
4,321,606
Here is the snippet I am using to display Google map on my app using their V3 Javascript API. ``` var myOptions = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); ``` But the map shows terrain, hyb...
2010/12/01
[ "https://Stackoverflow.com/questions/4321606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104450/" ]
You can [remove all the default UI](https://developers.google.com/maps/documentation/javascript/controls#DisablingDefaults) ``` var mapOptions = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: true }; var map = new google.maps.Map(document.getElemen...
[The Google Maps v3 API doc](http://code.google.com/apis/maps/documentation/javascript/reference.html) is great. In it, you'll find that [MapOptions](http://code.google.com/apis/maps/documentation/javascript/reference.html#MapOptions) have a property, "mapTypeControl", which is a boolean. Set it to `false` to disable ...
4,321,606
Here is the snippet I am using to display Google map on my app using their V3 Javascript API. ``` var myOptions = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); ``` But the map shows terrain, hyb...
2010/12/01
[ "https://Stackoverflow.com/questions/4321606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104450/" ]
You can [remove all the default UI](https://developers.google.com/maps/documentation/javascript/controls#DisablingDefaults) ``` var mapOptions = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: true }; var map = new google.maps.Map(document.getElemen...
So there's no URL attribute for disabling the satellite/terrain maps from Google's own embed code?
4,321,606
Here is the snippet I am using to display Google map on my app using their V3 Javascript API. ``` var myOptions = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); ``` But the map shows terrain, hyb...
2010/12/01
[ "https://Stackoverflow.com/questions/4321606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104450/" ]
You can [remove all the default UI](https://developers.google.com/maps/documentation/javascript/controls#DisablingDefaults) ``` var mapOptions = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: true }; var map = new google.maps.Map(document.getElemen...
To disable only map control, use this option in [Gmap3 documentation](https://developers.google.com/maps/documentation/javascript/reference?csw=1#MapOptions) : > > mapTypeControl > > Type: boolean > > > The initial enabled/disabled state of the Map type control. > > > example: ``` var options = { // .....
4,321,606
Here is the snippet I am using to display Google map on my app using their V3 Javascript API. ``` var myOptions = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); ``` But the map shows terrain, hyb...
2010/12/01
[ "https://Stackoverflow.com/questions/4321606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104450/" ]
[The Google Maps v3 API doc](http://code.google.com/apis/maps/documentation/javascript/reference.html) is great. In it, you'll find that [MapOptions](http://code.google.com/apis/maps/documentation/javascript/reference.html#MapOptions) have a property, "mapTypeControl", which is a boolean. Set it to `false` to disable ...
So there's no URL attribute for disabling the satellite/terrain maps from Google's own embed code?
4,321,606
Here is the snippet I am using to display Google map on my app using their V3 Javascript API. ``` var myOptions = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); ``` But the map shows terrain, hyb...
2010/12/01
[ "https://Stackoverflow.com/questions/4321606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104450/" ]
[The Google Maps v3 API doc](http://code.google.com/apis/maps/documentation/javascript/reference.html) is great. In it, you'll find that [MapOptions](http://code.google.com/apis/maps/documentation/javascript/reference.html#MapOptions) have a property, "mapTypeControl", which is a boolean. Set it to `false` to disable ...
To disable only map control, use this option in [Gmap3 documentation](https://developers.google.com/maps/documentation/javascript/reference?csw=1#MapOptions) : > > mapTypeControl > > Type: boolean > > > The initial enabled/disabled state of the Map type control. > > > example: ``` var options = { // .....
74,675,402
What I want to do is to create string stream , and output stream, giving the buffer of string stream to output stream, so that it will output data to the string stream. Everything seems fine, but when I try to add data to buffer of the string stream it overrides the previous data. My question is why? and how can achiev...
2022/12/04
[ "https://Stackoverflow.com/questions/74675402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15431634/" ]
The reason that the string in the `stringstream` object is being overwritten when you write to it using the `ostream` object is that, by default, the `ostream` object writes to the beginning of the stream buffer. This means that when you write the string "hey" to the `ostream` object, it replaces the initial string in ...
If you want to append the data in the beginning: ``` #include <iostream> #include <iomanip> #include <string> #include <sstream> using namespace std; int main() { stringstream s1("hello I am string stream"); streambuf *s1_bfr = s1.rdbuf(); stringstream temp; //Create a temp strin...
6,476,344
I am new android developer. When i run eclipse.exe the the following warning is shown Eclipse :eclipse.exe -Entry Point Not Found The procedure entry point \_JVM\_LoadSystemLibrary@4 could not be located in the dynamic link library jvm.dll what can i do now. please help me any one.
2011/06/25
[ "https://Stackoverflow.com/questions/6476344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/669904/" ]
Please make sure your JRE/JDK is properly installed. Check environment variables of your computer OS too.
Download this file and install it **Systems (KB2999226)** I've installed it on windows 7 for x64-based system and it worked!!! the link is given bellow... <https://www.microsoft.com/en-us/download/details.aspx?id=49093>
45,503,314
Is this right way to use AsyncReaderWriterLock ? Example: ``` private readonly static AsyncReaderWriterLock rwlMyClass = new AsyncReaderWriterLock(); private List<MyClass> my = new List<MyClass>(); public List<MyClass> My { get { using (rwlMyClass.ReaderLock()) ...
2017/08/04
[ "https://Stackoverflow.com/questions/45503314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3438246/" ]
First, you shouldn't be using `AsyncReaderWriterLock`. If you just want to protect the variable, then you can just use `lock`: ``` private readonly static object _mutex = new object(); private List<MyClass> my = new List<MyClass>(); public List<MyClass> My { get { lock (_mutex) { return my; } ...
in that case, you are not locking the list it self... the lock need to be while you access/modify the list, not just the list variable...
34,364,447
I'm seeing `:` used in JavaScript a good bit and I can not figure out what exactly what its doing. Is it naming something? For example is the function being named onSave? Example is below. ``` onSave: function() { var properties = this.getFormData(), request = this.wfsBody("usa", "usa:pecotest", "...
2015/12/18
[ "https://Stackoverflow.com/questions/34364447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
There are, as far as I know, four uses of `:` in JavaScript. The ternary operator, switch statements, [labels](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label), and part of JavaScript object creation. ``` // if a, then f is b. Otherwise it is C. var f = a? b: c; // This creates an o...
`:` is used as an `=` in an object - separating the object property from its value. Objects can also have functions as values. So what you're seeing is: ``` var obj = { onSave: function(){} } ``` could also be `obj.onSave = function(){}`
18,610,023
Hope someone can help me.. i made my program more simpler so that everybody will understand.. i want my program to get the value of the without submitting, i know that this can only be done by javascript or jquery so I use the onChange, but what I want is when i select an option the value should be passed immediately ...
2013/09/04
[ "https://Stackoverflow.com/questions/18610023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2746114/" ]
You cannot do this using PHP without submitting the page. PHP code executes on the server **before** the page is rendered in the browser. When a user then performs any action on the page (e.g. selects an item in a dropdown list), there is no PHP any more. The only way you can get this code into PHP is by submitting the...
not sure ..but i guess ajax is what you need.. ``` <script> function name_click(){ value_select = $("#id_select").val(); $.post('path/to/your/page',{"value":value_select},function(data){ alert('done') }) } </script> ``` PHP ``` $value=$_POST['value']; //gives you the value_select data ```
18,610,023
Hope someone can help me.. i made my program more simpler so that everybody will understand.. i want my program to get the value of the without submitting, i know that this can only be done by javascript or jquery so I use the onChange, but what I want is when i select an option the value should be passed immediately ...
2013/09/04
[ "https://Stackoverflow.com/questions/18610023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2746114/" ]
You cannot do this using PHP without submitting the page. PHP code executes on the server **before** the page is rendered in the browser. When a user then performs any action on the page (e.g. selects an item in a dropdown list), there is no PHP any more. The only way you can get this code into PHP is by submitting the...
My suggestion go with jquery. Try with this ``` <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> <script> $(document).ready(function(){ $("#id_select").change(function(){ var url = 'http:\\localhost\getdata.php'; //URL where you want to send data var p...
18,610,023
Hope someone can help me.. i made my program more simpler so that everybody will understand.. i want my program to get the value of the without submitting, i know that this can only be done by javascript or jquery so I use the onChange, but what I want is when i select an option the value should be passed immediately ...
2013/09/04
[ "https://Stackoverflow.com/questions/18610023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2746114/" ]
You cannot do this using PHP without submitting the page. PHP code executes on the server **before** the page is rendered in the browser. When a user then performs any action on the page (e.g. selects an item in a dropdown list), there is no PHP any more. The only way you can get this code into PHP is by submitting the...
Post with ajax as Alex G was telling you (+1) and then handle the post with PHP. You can define a callback in Javascript which will run when the page responds.
43,942,176
I write code for 'X' and 'o' game now everything works fine but I want to optimize my code and make my functions shorter for example I planned the game so the player play against the computer and the priorities of the computer would be to win first, then to block the opponent and eventually to fill the empty cells So...
2017/05/12
[ "https://Stackoverflow.com/questions/43942176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7335049/" ]
If you want to keep the data structure, you can try this. Simply organize at least the rows into a loop: ``` public static boolean ComuterrowWin(char [][] board){ for (int row=0; row<=2; row++) { if((board[row][0]=='O' && board[row][1]=='O') && board[row][2]!='X'){ board[row][2]='O'; return tr...
Adapting @galcoholic 's answer, how about this, ``` public static boolean ComuterrowWin(char [][] board){ int[][] win = {{0, 1, 2}, {1, 2, 0}, {0, 2, 1}}; for (int row = 0; row < 3; row++) { for(int i = 0; i < 3; i++){ if((board[row][win[i][0]]=='O' && board[row][win[i][1]]...
43,942,176
I write code for 'X' and 'o' game now everything works fine but I want to optimize my code and make my functions shorter for example I planned the game so the player play against the computer and the priorities of the computer would be to win first, then to block the opponent and eventually to fill the empty cells So...
2017/05/12
[ "https://Stackoverflow.com/questions/43942176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7335049/" ]
If you want to keep the data structure, you can try this. Simply organize at least the rows into a loop: ``` public static boolean ComuterrowWin(char [][] board){ for (int row=0; row<=2; row++) { if((board[row][0]=='O' && board[row][1]=='O') && board[row][2]!='X'){ board[row][2]='O'; return tr...
In response to the diagonal problem, here is how I suggest you do it, ``` public static boolean ComdiagonalgWin(char [][] board){ // For main diagonal, x_index = y_index for(int row = 0; row < 3; row++){ if((board[row % 3][row % 3] == 'O' && board[(row + 1) % 3][(row + 1) % 3]=='O') && bo...
43,942,176
I write code for 'X' and 'o' game now everything works fine but I want to optimize my code and make my functions shorter for example I planned the game so the player play against the computer and the priorities of the computer would be to win first, then to block the opponent and eventually to fill the empty cells So...
2017/05/12
[ "https://Stackoverflow.com/questions/43942176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7335049/" ]
Okay :-). What about this one ? ``` public static boolean ComuterrowWin(char [][] board){ for (int row=0; row<=2; row++) { for (int col=0; col<=2; col++) { if((board[row][(col+1)%3]=='O' && board[row][(col+2)%3]=='O') && board[row][col]!='X'){ board[row][col]='O'; return true;}...
Adapting @galcoholic 's answer, how about this, ``` public static boolean ComuterrowWin(char [][] board){ int[][] win = {{0, 1, 2}, {1, 2, 0}, {0, 2, 1}}; for (int row = 0; row < 3; row++) { for(int i = 0; i < 3; i++){ if((board[row][win[i][0]]=='O' && board[row][win[i][1]]...
43,942,176
I write code for 'X' and 'o' game now everything works fine but I want to optimize my code and make my functions shorter for example I planned the game so the player play against the computer and the priorities of the computer would be to win first, then to block the opponent and eventually to fill the empty cells So...
2017/05/12
[ "https://Stackoverflow.com/questions/43942176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7335049/" ]
Okay :-). What about this one ? ``` public static boolean ComuterrowWin(char [][] board){ for (int row=0; row<=2; row++) { for (int col=0; col<=2; col++) { if((board[row][(col+1)%3]=='O' && board[row][(col+2)%3]=='O') && board[row][col]!='X'){ board[row][col]='O'; return true;}...
In response to the diagonal problem, here is how I suggest you do it, ``` public static boolean ComdiagonalgWin(char [][] board){ // For main diagonal, x_index = y_index for(int row = 0; row < 3; row++){ if((board[row % 3][row % 3] == 'O' && board[(row + 1) % 3][(row + 1) % 3]=='O') && bo...
43,942,176
I write code for 'X' and 'o' game now everything works fine but I want to optimize my code and make my functions shorter for example I planned the game so the player play against the computer and the priorities of the computer would be to win first, then to block the opponent and eventually to fill the empty cells So...
2017/05/12
[ "https://Stackoverflow.com/questions/43942176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7335049/" ]
Adapting @galcoholic 's answer, how about this, ``` public static boolean ComuterrowWin(char [][] board){ int[][] win = {{0, 1, 2}, {1, 2, 0}, {0, 2, 1}}; for (int row = 0; row < 3; row++) { for(int i = 0; i < 3; i++){ if((board[row][win[i][0]]=='O' && board[row][win[i][1]]...
In response to the diagonal problem, here is how I suggest you do it, ``` public static boolean ComdiagonalgWin(char [][] board){ // For main diagonal, x_index = y_index for(int row = 0; row < 3; row++){ if((board[row % 3][row % 3] == 'O' && board[(row + 1) % 3][(row + 1) % 3]=='O') && bo...
44,375,192
Using a list for navigation, I am looking for a clean way to apply the 'selected' class to a list item if the page URL (minus anything after the path) matches the href of the list item (minus anything after the path). Example: ``` <li><a href="/p/clothing/dresses/N-10635?ab=leftNav:dresses">dresses</a></li> ``` App...
2017/06/05
[ "https://Stackoverflow.com/questions/44375192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3216091/" ]
you can use `indexOf()` ``` $(document).ready(function () { $('.leftNav li a').each(function(){ var ThisHref = ($(this).attr('href').split('?'))[0]; if(window.location.href.indexOf(ThisHref) > -1) { $(this).closest('li').addClass('selected'); } }); }); ``` **Example** ```j...
Assuming there isn't any '?' character in the actual path you could use something like this for both the location and the href: ``` function getBaseURL(url) { return url.split('?')[0]; } ```
44,375,192
Using a list for navigation, I am looking for a clean way to apply the 'selected' class to a list item if the page URL (minus anything after the path) matches the href of the list item (minus anything after the path). Example: ``` <li><a href="/p/clothing/dresses/N-10635?ab=leftNav:dresses">dresses</a></li> ``` App...
2017/06/05
[ "https://Stackoverflow.com/questions/44375192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3216091/" ]
you can use `indexOf()` ``` $(document).ready(function () { $('.leftNav li a').each(function(){ var ThisHref = ($(this).attr('href').split('?'))[0]; if(window.location.href.indexOf(ThisHref) > -1) { $(this).closest('li').addClass('selected'); } }); }); ``` **Example** ```j...
I guess if you keep your html like ``` <li><a href="/p/clothing/dresses/N-10635?ab=leftNav:dresses">dresses</a></li> ``` but change the comparisson to: ``` $('.leftNav li a').each(function(){ if (this.href.indexOf(location.pathname) > -1) { $(this).parents('li').addClass('selected'); } }); ``` you...
44,375,192
Using a list for navigation, I am looking for a clean way to apply the 'selected' class to a list item if the page URL (minus anything after the path) matches the href of the list item (minus anything after the path). Example: ``` <li><a href="/p/clothing/dresses/N-10635?ab=leftNav:dresses">dresses</a></li> ``` App...
2017/06/05
[ "https://Stackoverflow.com/questions/44375192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3216091/" ]
I guess if you keep your html like ``` <li><a href="/p/clothing/dresses/N-10635?ab=leftNav:dresses">dresses</a></li> ``` but change the comparisson to: ``` $('.leftNav li a').each(function(){ if (this.href.indexOf(location.pathname) > -1) { $(this).parents('li').addClass('selected'); } }); ``` you...
Assuming there isn't any '?' character in the actual path you could use something like this for both the location and the href: ``` function getBaseURL(url) { return url.split('?')[0]; } ```
30,295,174
I recently asked a question on [Programmers](https://softwareengineering.stackexchange.com/questions/284160/is-there-any-advantage-to-c-style-bit-manipulation-over-stdbitset) regarding reasons to use manual bit manipulation of primitive types over `std::bitset`. From that discussion I have concluded that the main reas...
2015/05/18
[ "https://Stackoverflow.com/questions/30295174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1613983/" ]
**Update** It's been ages since I posted this one, but: > > I already know that it is easier and clearer than bit-fiddling on an > integer, but is it as fast? > > > If you are using `bitset` in a way that does actually make it clearer and cleaner than bit-fiddling, like checking for one bit at a time instead of ...
Did a short test profiling std::bitset vs bool arrays for sequential and random access - you can too: ``` #include <iostream> #include <bitset> #include <cstdlib> // rand #include <ctime> // timer inline unsigned long get_time_in_ms() { return (unsigned long)((double(clock()) / CLOCKS_PER_SEC) * 1000); } void on...
30,295,174
I recently asked a question on [Programmers](https://softwareengineering.stackexchange.com/questions/284160/is-there-any-advantage-to-c-style-bit-manipulation-over-stdbitset) regarding reasons to use manual bit manipulation of primitive types over `std::bitset`. From that discussion I have concluded that the main reas...
2015/05/18
[ "https://Stackoverflow.com/questions/30295174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1613983/" ]
**Update** It's been ages since I posted this one, but: > > I already know that it is easier and clearer than bit-fiddling on an > integer, but is it as fast? > > > If you are using `bitset` in a way that does actually make it clearer and cleaner than bit-fiddling, like checking for one bit at a time instead of ...
In addition to what the other answers said about the performance of access, there may also be a significant space overhead: Typical `bitset<>` implementations simply use the longest integer type to back their bits. Thus, the following code ``` #include <bitset> #include <stdio.h> struct Bitfield { unsigned char a...
30,295,174
I recently asked a question on [Programmers](https://softwareengineering.stackexchange.com/questions/284160/is-there-any-advantage-to-c-style-bit-manipulation-over-stdbitset) regarding reasons to use manual bit manipulation of primitive types over `std::bitset`. From that discussion I have concluded that the main reas...
2015/05/18
[ "https://Stackoverflow.com/questions/30295174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1613983/" ]
**Update** It's been ages since I posted this one, but: > > I already know that it is easier and clearer than bit-fiddling on an > integer, but is it as fast? > > > If you are using `bitset` in a way that does actually make it clearer and cleaner than bit-fiddling, like checking for one bit at a time instead of ...
Not a great answer here, but rather a related anecdote: A few years ago I was working on real-time software and we ran into scheduling problems. There was a module which was way over time-budget, and this was very surprising because the module was only responsible for some mapping and packing/unpacking of bits into/f...
30,295,174
I recently asked a question on [Programmers](https://softwareengineering.stackexchange.com/questions/284160/is-there-any-advantage-to-c-style-bit-manipulation-over-stdbitset) regarding reasons to use manual bit manipulation of primitive types over `std::bitset`. From that discussion I have concluded that the main reas...
2015/05/18
[ "https://Stackoverflow.com/questions/30295174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1613983/" ]
**Update** It's been ages since I posted this one, but: > > I already know that it is easier and clearer than bit-fiddling on an > integer, but is it as fast? > > > If you are using `bitset` in a way that does actually make it clearer and cleaner than bit-fiddling, like checking for one bit at a time instead of ...
Rhetorical question: Why `std::bitset` is written in that inefficacy way? Answer: It is not. Another rhetorical question: What is difference between: ``` std::bitset<128> a = src; a[i] = true; a = a << 64; ``` and ``` std::bitset<129> a = src; a[i] = true; a = a << 63; ``` Answer: 50 times difference in performa...
30,295,174
I recently asked a question on [Programmers](https://softwareengineering.stackexchange.com/questions/284160/is-there-any-advantage-to-c-style-bit-manipulation-over-stdbitset) regarding reasons to use manual bit manipulation of primitive types over `std::bitset`. From that discussion I have concluded that the main reas...
2015/05/18
[ "https://Stackoverflow.com/questions/30295174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1613983/" ]
Did a short test profiling std::bitset vs bool arrays for sequential and random access - you can too: ``` #include <iostream> #include <bitset> #include <cstdlib> // rand #include <ctime> // timer inline unsigned long get_time_in_ms() { return (unsigned long)((double(clock()) / CLOCKS_PER_SEC) * 1000); } void on...
In addition to what the other answers said about the performance of access, there may also be a significant space overhead: Typical `bitset<>` implementations simply use the longest integer type to back their bits. Thus, the following code ``` #include <bitset> #include <stdio.h> struct Bitfield { unsigned char a...
30,295,174
I recently asked a question on [Programmers](https://softwareengineering.stackexchange.com/questions/284160/is-there-any-advantage-to-c-style-bit-manipulation-over-stdbitset) regarding reasons to use manual bit manipulation of primitive types over `std::bitset`. From that discussion I have concluded that the main reas...
2015/05/18
[ "https://Stackoverflow.com/questions/30295174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1613983/" ]
Did a short test profiling std::bitset vs bool arrays for sequential and random access - you can too: ``` #include <iostream> #include <bitset> #include <cstdlib> // rand #include <ctime> // timer inline unsigned long get_time_in_ms() { return (unsigned long)((double(clock()) / CLOCKS_PER_SEC) * 1000); } void on...
Not a great answer here, but rather a related anecdote: A few years ago I was working on real-time software and we ran into scheduling problems. There was a module which was way over time-budget, and this was very surprising because the module was only responsible for some mapping and packing/unpacking of bits into/f...
30,295,174
I recently asked a question on [Programmers](https://softwareengineering.stackexchange.com/questions/284160/is-there-any-advantage-to-c-style-bit-manipulation-over-stdbitset) regarding reasons to use manual bit manipulation of primitive types over `std::bitset`. From that discussion I have concluded that the main reas...
2015/05/18
[ "https://Stackoverflow.com/questions/30295174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1613983/" ]
Did a short test profiling std::bitset vs bool arrays for sequential and random access - you can too: ``` #include <iostream> #include <bitset> #include <cstdlib> // rand #include <ctime> // timer inline unsigned long get_time_in_ms() { return (unsigned long)((double(clock()) / CLOCKS_PER_SEC) * 1000); } void on...
Rhetorical question: Why `std::bitset` is written in that inefficacy way? Answer: It is not. Another rhetorical question: What is difference between: ``` std::bitset<128> a = src; a[i] = true; a = a << 64; ``` and ``` std::bitset<129> a = src; a[i] = true; a = a << 63; ``` Answer: 50 times difference in performa...
22,462,807
I am struggling to understand how to access local class variable in an action delegate when both the delegate is anonymous and the containing class is created just in time as an argument to a function. The delegate seems to have access to calling functions variables, and it's containing class, but not to the class th...
2014/03/17
[ "https://Stackoverflow.com/questions/22462807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28373/" ]
The action needs to be created before the `QueryPropertyMessage` has been created, or even *defined*, for you to be able to pass it into its constructor. There is therefore nothing to reference at that point in time. You need to create, or at least define a variable for, the object in question first. ``` QueryProperty...
It's somewhat painful to do so. You basically need to declare a local variable, give it a temporary value (so that it's definitely assigned) and then use that local variable: ``` QueryPropertyMessage message = null; message = new QueryPropertyMessage(() => { // Use message in here }); SomeClass.FunctionAcceptingQu...
22,462,807
I am struggling to understand how to access local class variable in an action delegate when both the delegate is anonymous and the containing class is created just in time as an argument to a function. The delegate seems to have access to calling functions variables, and it's containing class, but not to the class th...
2014/03/17
[ "https://Stackoverflow.com/questions/22462807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28373/" ]
It's somewhat painful to do so. You basically need to declare a local variable, give it a temporary value (so that it's definitely assigned) and then use that local variable: ``` QueryPropertyMessage message = null; message = new QueryPropertyMessage(() => { // Use message in here }); SomeClass.FunctionAcceptingQu...
You can't do that. The delegate has no idea that it's being passed to a constructor. That's like an `int` being aware of the type that contains it. One way to solve this is to make your setter public, create the instance of `QueryPropertyMessage`, and then set the delegate. ``` var query = new QueryPropertyMessage();...
22,462,807
I am struggling to understand how to access local class variable in an action delegate when both the delegate is anonymous and the containing class is created just in time as an argument to a function. The delegate seems to have access to calling functions variables, and it's containing class, but not to the class th...
2014/03/17
[ "https://Stackoverflow.com/questions/22462807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28373/" ]
It's somewhat painful to do so. You basically need to declare a local variable, give it a temporary value (so that it's definitely assigned) and then use that local variable: ``` QueryPropertyMessage message = null; message = new QueryPropertyMessage(() => { // Use message in here }); SomeClass.FunctionAcceptingQu...
Solution for your problem will be you need to change the Action<> type to `Action<QueryPropertyMessage>` Callback ``` class QueryPropertyMessage { public Action<QueryPropertyMessage> Callback { get; private set; } public string PropertyName { get; set; } public object PropertyValue { get; set; } publi...
22,462,807
I am struggling to understand how to access local class variable in an action delegate when both the delegate is anonymous and the containing class is created just in time as an argument to a function. The delegate seems to have access to calling functions variables, and it's containing class, but not to the class th...
2014/03/17
[ "https://Stackoverflow.com/questions/22462807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28373/" ]
The action needs to be created before the `QueryPropertyMessage` has been created, or even *defined*, for you to be able to pass it into its constructor. There is therefore nothing to reference at that point in time. You need to create, or at least define a variable for, the object in question first. ``` QueryProperty...
You can't do that. The delegate has no idea that it's being passed to a constructor. That's like an `int` being aware of the type that contains it. One way to solve this is to make your setter public, create the instance of `QueryPropertyMessage`, and then set the delegate. ``` var query = new QueryPropertyMessage();...
22,462,807
I am struggling to understand how to access local class variable in an action delegate when both the delegate is anonymous and the containing class is created just in time as an argument to a function. The delegate seems to have access to calling functions variables, and it's containing class, but not to the class th...
2014/03/17
[ "https://Stackoverflow.com/questions/22462807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28373/" ]
The action needs to be created before the `QueryPropertyMessage` has been created, or even *defined*, for you to be able to pass it into its constructor. There is therefore nothing to reference at that point in time. You need to create, or at least define a variable for, the object in question first. ``` QueryProperty...
Solution for your problem will be you need to change the Action<> type to `Action<QueryPropertyMessage>` Callback ``` class QueryPropertyMessage { public Action<QueryPropertyMessage> Callback { get; private set; } public string PropertyName { get; set; } public object PropertyValue { get; set; } publi...
22,462,807
I am struggling to understand how to access local class variable in an action delegate when both the delegate is anonymous and the containing class is created just in time as an argument to a function. The delegate seems to have access to calling functions variables, and it's containing class, but not to the class th...
2014/03/17
[ "https://Stackoverflow.com/questions/22462807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28373/" ]
You can't do that. The delegate has no idea that it's being passed to a constructor. That's like an `int` being aware of the type that contains it. One way to solve this is to make your setter public, create the instance of `QueryPropertyMessage`, and then set the delegate. ``` var query = new QueryPropertyMessage();...
Solution for your problem will be you need to change the Action<> type to `Action<QueryPropertyMessage>` Callback ``` class QueryPropertyMessage { public Action<QueryPropertyMessage> Callback { get; private set; } public string PropertyName { get; set; } public object PropertyValue { get; set; } publi...
49,326,927
This is probably a very basic question but I haven't been able to find the answer so here goes... Question: Is there an say way to sort the values alphabetically while also removing any duplicate instances? Here's what I have: ``` data = ['Car | Book | Apple','','Book | Car | Apple | Apple'] df = pd.DataFrame(data,...
2018/03/16
[ "https://Stackoverflow.com/questions/49326927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9448079/" ]
`str.join` after `str.split` ``` df=df.replace({' ':''},regex=True) df.Labels.str.split('|').apply(set).str.join('|') Out[339]: 0 Apple|Book|Car 1 2 Apple|Book|Car Name: Labels, dtype: object ``` Base on the comment adding `sorted` ``` df.Labels.str.split('|').apply(lambda x : sorted(set(x)...
`df['Labels'].str.split('|')` will split the string on `|` and return a list ``` #0 [Car , Book , Apple] #1 [] #2 [Book , Car , Apple , Apple] #Name: Labels, dtype: object ``` See that there are extra spaces in the resulting list elements. One way to remove those i...
49,326,927
This is probably a very basic question but I haven't been able to find the answer so here goes... Question: Is there an say way to sort the values alphabetically while also removing any duplicate instances? Here's what I have: ``` data = ['Car | Book | Apple','','Book | Car | Apple | Apple'] df = pd.DataFrame(data,...
2018/03/16
[ "https://Stackoverflow.com/questions/49326927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9448079/" ]
`str.join` after `str.split` ``` df=df.replace({' ':''},regex=True) df.Labels.str.split('|').apply(set).str.join('|') Out[339]: 0 Apple|Book|Car 1 2 Apple|Book|Car Name: Labels, dtype: object ``` Base on the comment adding `sorted` ``` df.Labels.str.split('|').apply(lambda x : sorted(set(x)...
One way is to use `pd.Series.map` with `sorted` & `set` after splitting by `|`: ``` import pandas as pd data = ['Car | Book | Apple','','Book | Car | Apple | Apple'] df = pd.DataFrame(data,columns=['Labels']) df['Labels'] = df['Labels'].map(lambda x: ' | '.join(sorted(set(x.split(' | '))))) # Labels ...
35,503,464
My app crashes on some devices giving `JAVA.lang.outofmemory` Error while all the data is parsed from a database on an online server. Despite of having small reduced Images (MAX. SIZE 20 Kb) it gives a BITMAP Out of Memory Error. I have attached the crash log and xml for the activity. Few devices it crashes on include ...
2016/02/19
[ "https://Stackoverflow.com/questions/35503464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5950615/" ]
In mysql you can use joins in updates to achive the expected results: ``` update table2 t2 inner join table1 t1 on t2.rand=t1.rand set t2.cpn=t1.cpn ```
Well, you should `JOIN` the tables so you can use the values, like so: ``` UPDATE Table_2 t2 LEFT JOIN Table_1 t1 on t2.rand = t1.rand SET t2.cpn = t1.cpn; ```
35,503,464
My app crashes on some devices giving `JAVA.lang.outofmemory` Error while all the data is parsed from a database on an online server. Despite of having small reduced Images (MAX. SIZE 20 Kb) it gives a BITMAP Out of Memory Error. I have attached the crash log and xml for the activity. Few devices it crashes on include ...
2016/02/19
[ "https://Stackoverflow.com/questions/35503464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5950615/" ]
This should work: ``` update table2 t2 set cpn = (select cpn from table1 where rand = t2.rand) ```
Well, you should `JOIN` the tables so you can use the values, like so: ``` UPDATE Table_2 t2 LEFT JOIN Table_1 t1 on t2.rand = t1.rand SET t2.cpn = t1.cpn; ```
35,503,464
My app crashes on some devices giving `JAVA.lang.outofmemory` Error while all the data is parsed from a database on an online server. Despite of having small reduced Images (MAX. SIZE 20 Kb) it gives a BITMAP Out of Memory Error. I have attached the crash log and xml for the activity. Few devices it crashes on include ...
2016/02/19
[ "https://Stackoverflow.com/questions/35503464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5950615/" ]
In mysql you can use joins in updates to achive the expected results: ``` update table2 t2 inner join table1 t1 on t2.rand=t1.rand set t2.cpn=t1.cpn ```
You can use this. it INSERT OR UPDATE Records. You only must have a unique INDEX or PRIMARY KEY on rand. ``` INSERT INTO Table_2 (SELECT * FROM Table_1 ) ON DUPLICATE KEY UPDATE cpn = VALUES(cpn); ``` **SAMPLE** ``` MariaDB []> MariaDB []> CREATE TABLE `Table_1` ( -> `rand` INT(11) UNSIGNED NOT NULL AUTO_IN...
35,503,464
My app crashes on some devices giving `JAVA.lang.outofmemory` Error while all the data is parsed from a database on an online server. Despite of having small reduced Images (MAX. SIZE 20 Kb) it gives a BITMAP Out of Memory Error. I have attached the crash log and xml for the activity. Few devices it crashes on include ...
2016/02/19
[ "https://Stackoverflow.com/questions/35503464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5950615/" ]
This should work: ``` update table2 t2 set cpn = (select cpn from table1 where rand = t2.rand) ```
You can use this. it INSERT OR UPDATE Records. You only must have a unique INDEX or PRIMARY KEY on rand. ``` INSERT INTO Table_2 (SELECT * FROM Table_1 ) ON DUPLICATE KEY UPDATE cpn = VALUES(cpn); ``` **SAMPLE** ``` MariaDB []> MariaDB []> CREATE TABLE `Table_1` ( -> `rand` INT(11) UNSIGNED NOT NULL AUTO_IN...
65,970,597
I am wondering if there is a way to get the **full** URL using only liquid (Shopify templating language). I know there are the below provided but none of them (even combined) seem to achieve it. It can be done with javascript using `window.location.href`, but I am wondering if there is a liquid-only method. For my use ...
2021/01/30
[ "https://Stackoverflow.com/questions/65970597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13262682/" ]
Here is the one of odd method to get the values from the query string of URL, but it comes with some coding working, you can it using this [link](https://freakdesign.com.au/blogs/news/get-the-url-querystring-values-with-liquid-in-shopify)
You can get the root URL as follows: ```html {{ request.origin }} {{ request.host }} ```
23,073,320
I am using `Flask` and `SQLAlchemy`. I have a `Person` model and I want an attribute which returns the `Person`'s full name (first + last). I tried using `@declared_attr`, but it outputs: ``` "person.first_name || :param_1 || person.last_name" ``` Here is my code: ```py class Person(Base): __tablename__ = 'per...
2014/04/15
[ "https://Stackoverflow.com/questions/23073320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1877173/" ]
Use the [hybrid](http://sqlalchemy.readthedocs.org/en/rel_0_9/orm/extensions/hybrid.html) extension: ``` from sqlalchemy.ext.hybrid import hybrid_property class Person(Base): # ... @hybrid_property def name(self): return '{0} {1}'.format(self.first_name, self.last_name) @name.setter def n...
@davidism suggested using hybrid extension, whilst I say, why not use SQLAlchemy's [`column_property` function](https://docs.sqlalchemy.org/en/latest/orm/mapping_columns.html#using-column-property-for-column-level-options)? Example: ``` class User(Base): __tablename__ = 'user' id = Column(Integer, primary_key...
17,633,524
I'm having trouble exporting my first APK in eclipse. When I click on finish, I get the message: `No build tools installed in the SDK.` I've googled the problem but all the results say that i have to install `Android SDK Tools`, but I have it and it's been updated (22.0.1). Any ideas? Thanks! EDIT: I have ALL the p...
2013/07/13
[ "https://Stackoverflow.com/questions/17633524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1958354/" ]
From version 22 forward the build tools is a separate package. Open then Android SDK Manager and check Android SDK Build-tools and click install. The package will download and you'll be able to export/build. ![enter image description here](https://i.stack.imgur.com/SpIZ8.png)
If eclipse is pointing to the wrong Android SDK it won't find the build tools. If you're sure you installed the right build tools, it may be that eclipse is pointed to the wrong directory. So if you're on windows, in eclipse, goto Window -> Preferences -> Android, and check the field in "SDK Location" eclipse is lookin...
19,889,961
I trying to figure out why my App crashes sometimes on costumers devices. My App is from the AppStore. It happend not always, only in rare cases it seams. Here is the used codeblock ``` [UIView animateWithDuration:0.3 animations:^(void){ [self.spinner setAlpha:0.0]; } completion:^(BOOL finished){ if(self.spinner ...
2013/11/10
[ "https://Stackoverflow.com/questions/19889961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1147315/" ]
Please try following: ``` $query = "SELECT DISTINCT login.id_user, login.company, login.district, FROM login LEFT JOIN products ON login.id_user = products.id_user WHERE (login.district LIKE ? AND login.place LI...
If you just need exact match to appear as the first one in the result, then you should add something like this to your query: ``` [...] ORDER BY CASE WHEN checked_column = 'keyword' THEN 1 /* exact match */ ELSE 2 /* non-exact match */ END, checked_column /* sort non-exact matches */ ``` But if you ...
29,483,498
Is it possible and what would be the most efficient neat method to add a column to Data Frame? More specifically, column may serve as Row IDs for the existing Data Frame. In a simplified case, reading from file and not tokenizing it, I can think of something as below (in Scala), but it completes with errors (at line...
2015/04/07
[ "https://Stackoverflow.com/questions/29483498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2028058/" ]
It's been a while since I posted the question and it seems that some other people would like to get an answer as well. Below is what I found. So the original task was to append a column with row identificators (basically, a sequence `1 to numRows`) to any given data frame, so the rows order/presence can be tracked (e....
I took help from above answer. However, I find it incomplete if we want to change a `DataFrame` and current APIs are little different in `Spark 1.6`. `zipWithIndex()` returns a `Tuple` of `(Row, Long)` which contains each row and corresponding index. We can use it to create new `Row` according to our need. ``` val r...