qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
11,345,954
I'm trying to push to a two-dimensional array without it messing up, currently My array is: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] ``` And my code I'm trying is: ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = r; i < rows; i++) { f...
2012/07/05
[ "https://Stackoverflow.com/questions/11345954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497481/" ]
You have some errors in your code: 1. Use `myArray[i].push( 0 );` to add a new column. Your code (`myArray[i][j].push(0);`) would work in a 3-dimensional array as it tries to add another element to an array at position `[i][j]`. 2. You only expand (col-d)-many columns in all rows, even in those, which haven't been ini...
you are calling the push() on an array element (int), where push() should be called on the array, also handling/filling the array this way makes no sense you can do it like this ``` for (var i = 0; i < rows - 1; i++) { for (var j = c; j < cols; j++) { myArray[i].push(0); } } for (var i = r; i < rows - 1; i+...
11,345,954
I'm trying to push to a two-dimensional array without it messing up, currently My array is: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] ``` And my code I'm trying is: ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = r; i < rows; i++) { f...
2012/07/05
[ "https://Stackoverflow.com/questions/11345954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497481/" ]
You have some errors in your code: 1. Use `myArray[i].push( 0 );` to add a new column. Your code (`myArray[i][j].push(0);`) would work in a 3-dimensional array as it tries to add another element to an array at position `[i][j]`. 2. You only expand (col-d)-many columns in all rows, even in those, which haven't been ini...
You can also try like this. ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = r; i < rows; i++) { for (var j = c; j < cols; j++) { myArray.push([var[i],var[j]) } } ``` this will create a 2d array for you.
11,345,954
I'm trying to push to a two-dimensional array without it messing up, currently My array is: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] ``` And my code I'm trying is: ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = r; i < rows; i++) { f...
2012/07/05
[ "https://Stackoverflow.com/questions/11345954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497481/" ]
You have to loop through all rows, and add the missing rows and columns. For the already existing rows, you loop from c to cols, for the new rows, first push an empty array to outer array, then loop from 0 to cols: ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var ...
``` <script> let test = new Array; for(let i = 1; i < 10; i++){ test[i] = new Array; test[i]['type'] = 'test-type'+i; test[i]['content'] = 'test-content'+i; } console.log(test); </script> ```
11,345,954
I'm trying to push to a two-dimensional array without it messing up, currently My array is: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] ``` And my code I'm trying is: ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = r; i < rows; i++) { f...
2012/07/05
[ "https://Stackoverflow.com/questions/11345954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497481/" ]
In your case you can do that without using `push` at all: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] var newRows = 8; var newCols = 7; var item; for (var i = 0; i < newRows; i++) { item = myArray[i] || (myArray[i] = []); for (var k = item.length; k < newCols; k++) item[...
Create am array and put inside the first, in this case i get data from JSON response ``` $.getJSON('/Tool/GetAllActiviesStatus/', var dataFC = new Array(); function (data) { for (var i = 0; i < data.Result.length; i++) { var serie = new Array(data.Result[i].FUNCAO, data.Result[i].QT, true, true);...
11,345,954
I'm trying to push to a two-dimensional array without it messing up, currently My array is: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] ``` And my code I'm trying is: ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = r; i < rows; i++) { f...
2012/07/05
[ "https://Stackoverflow.com/questions/11345954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497481/" ]
Iterating over two dimensions means you'll need to check over two dimensions. assuming you're starting with: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ]; //don't forget your semi-colons ``` You want to expand this two-dimensional array to become: ``` var myArray = [ [1,1,1,1,1,0,0],...
You can also try like this. ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = r; i < rows; i++) { for (var j = c; j < cols; j++) { myArray.push([var[i],var[j]) } } ``` this will create a 2d array for you.
56,780,484
I have a request filter that sits in front of a controller. This filter retrieves a user profile and sets the properties on a `userProfile` Component with Request Scope and then passes on to the next filter. When trying to access the `userProfile` from inside the filter, the property has not been successfully autowire...
2019/06/26
[ "https://Stackoverflow.com/questions/56780484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5625689/" ]
I believe the issue may be that you are attempting to inject a request-scoped bean (smaller scope) into a singleton-scoped bean (larger scope). There are a couple of reasons why this won't work: * No request scope is active when the singleton is instantiated * For the second request, the singleton would be working wit...
When Spring Boot detects a `Filter` in the `ApplicationContext` it will automatically register it in the chain of filters for the servlet container. However you don't want this to happen in this case as the filter is part of the Spring Security filter chain. To fix do the following: 1. Remove `@Component` from your ...
11,158,957
In my application there is a ListFragment where each item from the list contains a checkbox. Whenever the user clicks on one of those checkboxes the app starts an ActionMode context menu. But I want the application to close the ActionMode menu when clicking on another component. I tried `Fragment#closeContextMenu()` wi...
2012/06/22
[ "https://Stackoverflow.com/questions/11158957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/397244/" ]
Whenever you are creating/starting ActionMode Create by ``` mMode = startActionMode(....); ``` To Dismiss it use following Syntax ``` if (mMode != null) { mMode.finish(); } ```
*Kotlin code* Use **ActionMode.Callback** to finish `ActionMode` after menu item pressed ``` private val actionModeCallbacks = object : ActionMode.Callback { override fun onCreateActionMode(mode: ActionMode, menu: Menu): Boolean { mode.menuInflater.inflate(R.menu.menu_action_mode, menu) return tr...
11,158,957
In my application there is a ListFragment where each item from the list contains a checkbox. Whenever the user clicks on one of those checkboxes the app starts an ActionMode context menu. But I want the application to close the ActionMode menu when clicking on another component. I tried `Fragment#closeContextMenu()` wi...
2012/06/22
[ "https://Stackoverflow.com/questions/11158957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/397244/" ]
Whenever you are creating/starting ActionMode Create by ``` mMode = startActionMode(....); ``` To Dismiss it use following Syntax ``` if (mMode != null) { mMode.finish(); } ```
``` actionMode.finish(); ``` When finish method is called from actionmode ...it will destroy the action mode. ``` @Override public void onDestroyActionMode(ActionMode mode) { //When action mode destroyed remove selected selections and set action mode to null } ``` and destroy method is called from callback e...
11,158,957
In my application there is a ListFragment where each item from the list contains a checkbox. Whenever the user clicks on one of those checkboxes the app starts an ActionMode context menu. But I want the application to close the ActionMode menu when clicking on another component. I tried `Fragment#closeContextMenu()` wi...
2012/06/22
[ "https://Stackoverflow.com/questions/11158957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/397244/" ]
``` actionMode.finish(); ``` When finish method is called from actionmode ...it will destroy the action mode. ``` @Override public void onDestroyActionMode(ActionMode mode) { //When action mode destroyed remove selected selections and set action mode to null } ``` and destroy method is called from callback e...
*Kotlin code* Use **ActionMode.Callback** to finish `ActionMode` after menu item pressed ``` private val actionModeCallbacks = object : ActionMode.Callback { override fun onCreateActionMode(mode: ActionMode, menu: Menu): Boolean { mode.menuInflater.inflate(R.menu.menu_action_mode, menu) return tr...
6,171,870
I'm using MySQL, and I want to sort a record or I want to group a record then sort it again by another condition like for example I have 6 items, ``` Names Group Jack G1 Dian G2 Emily G2 Dean G1 Teddy G2 Gabe G1 ``` So I want to sort this by group in alphabetized orby by name. Like, ``` Dean G1 Gabe G1 Jack ...
2011/05/30
[ "https://Stackoverflow.com/questions/6171870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130278/" ]
So you want to order by one column first and then another? You can specify more than one column in the `ORDER BY` clause of a query - separate them by commas, and the first one will be the 'major' sort, then subsequent columns in the list will be sorted within that.
``` Select * from MyTable order by MyGroup, MyNames ```
6,171,870
I'm using MySQL, and I want to sort a record or I want to group a record then sort it again by another condition like for example I have 6 items, ``` Names Group Jack G1 Dian G2 Emily G2 Dean G1 Teddy G2 Gabe G1 ``` So I want to sort this by group in alphabetized orby by name. Like, ``` Dean G1 Gabe G1 Jack ...
2011/05/30
[ "https://Stackoverflow.com/questions/6171870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130278/" ]
So you want to order by one column first and then another? You can specify more than one column in the `ORDER BY` clause of a query - separate them by commas, and the first one will be the 'major' sort, then subsequent columns in the list will be sorted within that.
Use two `ORDER BY`s. ``` ORDER BY Group ASC, Name ASC ```
6,171,870
I'm using MySQL, and I want to sort a record or I want to group a record then sort it again by another condition like for example I have 6 items, ``` Names Group Jack G1 Dian G2 Emily G2 Dean G1 Teddy G2 Gabe G1 ``` So I want to sort this by group in alphabetized orby by name. Like, ``` Dean G1 Gabe G1 Jack ...
2011/05/30
[ "https://Stackoverflow.com/questions/6171870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130278/" ]
So you want to order by one column first and then another? You can specify more than one column in the `ORDER BY` clause of a query - separate them by commas, and the first one will be the 'major' sort, then subsequent columns in the list will be sorted within that.
``` SELECT Names, Group FROM 'table_name' ORDER BY Names DESC ```
6,171,870
I'm using MySQL, and I want to sort a record or I want to group a record then sort it again by another condition like for example I have 6 items, ``` Names Group Jack G1 Dian G2 Emily G2 Dean G1 Teddy G2 Gabe G1 ``` So I want to sort this by group in alphabetized orby by name. Like, ``` Dean G1 Gabe G1 Jack ...
2011/05/30
[ "https://Stackoverflow.com/questions/6171870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130278/" ]
So you want to order by one column first and then another? You can specify more than one column in the `ORDER BY` clause of a query - separate them by commas, and the first one will be the 'major' sort, then subsequent columns in the list will be sorted within that.
``` select Names, Group from MyTable order by Group, Names ``` The order by list does not have to be in the same order as the select list columns.
6,171,870
I'm using MySQL, and I want to sort a record or I want to group a record then sort it again by another condition like for example I have 6 items, ``` Names Group Jack G1 Dian G2 Emily G2 Dean G1 Teddy G2 Gabe G1 ``` So I want to sort this by group in alphabetized orby by name. Like, ``` Dean G1 Gabe G1 Jack ...
2011/05/30
[ "https://Stackoverflow.com/questions/6171870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130278/" ]
``` Select * from MyTable order by MyGroup, MyNames ```
``` SELECT Names, Group FROM 'table_name' ORDER BY Names DESC ```
6,171,870
I'm using MySQL, and I want to sort a record or I want to group a record then sort it again by another condition like for example I have 6 items, ``` Names Group Jack G1 Dian G2 Emily G2 Dean G1 Teddy G2 Gabe G1 ``` So I want to sort this by group in alphabetized orby by name. Like, ``` Dean G1 Gabe G1 Jack ...
2011/05/30
[ "https://Stackoverflow.com/questions/6171870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130278/" ]
``` Select * from MyTable order by MyGroup, MyNames ```
``` select Names, Group from MyTable order by Group, Names ``` The order by list does not have to be in the same order as the select list columns.
6,171,870
I'm using MySQL, and I want to sort a record or I want to group a record then sort it again by another condition like for example I have 6 items, ``` Names Group Jack G1 Dian G2 Emily G2 Dean G1 Teddy G2 Gabe G1 ``` So I want to sort this by group in alphabetized orby by name. Like, ``` Dean G1 Gabe G1 Jack ...
2011/05/30
[ "https://Stackoverflow.com/questions/6171870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130278/" ]
Use two `ORDER BY`s. ``` ORDER BY Group ASC, Name ASC ```
``` SELECT Names, Group FROM 'table_name' ORDER BY Names DESC ```
6,171,870
I'm using MySQL, and I want to sort a record or I want to group a record then sort it again by another condition like for example I have 6 items, ``` Names Group Jack G1 Dian G2 Emily G2 Dean G1 Teddy G2 Gabe G1 ``` So I want to sort this by group in alphabetized orby by name. Like, ``` Dean G1 Gabe G1 Jack ...
2011/05/30
[ "https://Stackoverflow.com/questions/6171870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130278/" ]
Use two `ORDER BY`s. ``` ORDER BY Group ASC, Name ASC ```
``` select Names, Group from MyTable order by Group, Names ``` The order by list does not have to be in the same order as the select list columns.
6,171,870
I'm using MySQL, and I want to sort a record or I want to group a record then sort it again by another condition like for example I have 6 items, ``` Names Group Jack G1 Dian G2 Emily G2 Dean G1 Teddy G2 Gabe G1 ``` So I want to sort this by group in alphabetized orby by name. Like, ``` Dean G1 Gabe G1 Jack ...
2011/05/30
[ "https://Stackoverflow.com/questions/6171870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130278/" ]
``` select Names, Group from MyTable order by Group, Names ``` The order by list does not have to be in the same order as the select list columns.
``` SELECT Names, Group FROM 'table_name' ORDER BY Names DESC ```
6,514,983
The [Amazon CloudFront documentation](http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/) doesn't mention what the "CallerReference" is for or what I should fill it with, the examples I have seen on other sites use a guid or the current date. The [AWS SDK for .NET](http://aws.amazon.com/sdkfornet/...
2011/06/29
[ "https://Stackoverflow.com/questions/6514983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74449/" ]
The [Amazon CloudFront Documentation](http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/Welcome.html?r=5082) (meanwhile?!) states that CallerReference is *A unique name that ensures the request can't be replayed* indeed, see [InvalidationBatch Complex Type](http://docs.amazonwebservices.com/Amazo...
my 2 cents for someone reading this in futuer: CallerReference is also useful with complex and automated cloud based setup. Think of a deployment setup with many scripts from different hosts are running independently to verifying and creating CloudFront distribution. In such case you want only one create request to be...
2,934,844
Suppose that $A$ and $B$ are two real square matrices and $A^TA=B^TB$. Can we say that $A=QB$ for some orthogonal matrix $Q$? If they are vectors we have $\|a\|^2=a^Ta=b^Tb=\|b\|^2$, so intuitively clear, since we just have to rotate. But it is hard to picture the matrix case but I have not been able to show.
2018/09/28
[ "https://math.stackexchange.com/questions/2934844", "https://math.stackexchange.com", "https://math.stackexchange.com/users/352317/" ]
The answer is yes. In particular, it suffices to show that for every matrix $A$, there exists an orthogonal matrix $U$ such that $$ A = U \sqrt{A^TA} $$ which is to say that each matrix has a [polar decomposition](https://en.wikipedia.org/wiki/Polar_decomposition).
There is also a nice geometric way to see this. The geometric interpretation of the singular value decomposition says that a $(n\times n)$-matrix $A$ maps the unit $(n-1)$-sphere in $\mathbb{R}^n$ to a hyperellipsoid. The lengths of the axes of this ellipsoid are the roots of the eigenvalues of $A^T A$. So if $A^T A...
129,634
We know that 'scientific disciplines divide the particulars they study into kinds'. But there are also taxonomy categories that rank above a kind (of particulars). In that case, the kind mediates that higher category and a particular: it acts as a middle category between them. For example, a biological species mediate ...
2017/05/16
[ "https://ell.stackexchange.com/questions/129634", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/52505/" ]
**Auxiliary verbs in declarative sentences are used to emphasize the idea expressed by the verb, when the verb takes an auxiliary**. Emphasis for tenses where auxiliaries are part of the sentence is heard through intonation only. 1) Perhaps she **had** asmthma. → Perhaps she **did have** asthma. 2) They read a lot of ...
While you may think > > She +**has** asthma. > > > should be together, that is the *present tense*. However, your sentence is in the *past tense* > > She **had** asthma. > > > When formed with **did** + *infinitive root* creates the \*past > > She **did have** asthma. > > >
129,634
We know that 'scientific disciplines divide the particulars they study into kinds'. But there are also taxonomy categories that rank above a kind (of particulars). In that case, the kind mediates that higher category and a particular: it acts as a middle category between them. For example, a biological species mediate ...
2017/05/16
[ "https://ell.stackexchange.com/questions/129634", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/52505/" ]
**Auxiliary verbs in declarative sentences are used to emphasize the idea expressed by the verb, when the verb takes an auxiliary**. Emphasis for tenses where auxiliaries are part of the sentence is heard through intonation only. 1) Perhaps she **had** asmthma. → Perhaps she **did have** asthma. 2) They read a lot of ...
She did have. >>> You can only use the original form of the verb after the verb "do". Grammatically, you can even say "she does do sth." >> Means "She indeed does sth."
41,608
One of the absorption is of Infinite Space. Did the dimension of Infinite Space had a beginning and therefore it is impermanent and non-self? If yes then how much time did it took for this 'plane of existence' of infinite space to begin from 0 to infinity? Was it instantaneous? (I will explain my second question i...
2020/09/20
[ "https://buddhism.stackexchange.com/questions/41608", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/17553/" ]
The Buddha teaches the truths that lead to the end of suffering. That teaching clearly indicates that the *perception* of infinite space begins with the relinquishing of the perception of form. > > [MN121:6.1](https://suttacentral.net/mn121/en/sujato#mn121:6.1): Furthermore, a mendicant—ignoring the perception of wil...
Good householder can choose a beginning of the wheel, on a circle, where ever he likes, like if asking, "had his infinitive useless question a beginning? *[Note that this isn't given for stacks, exchange, other world-binding trades but for an escape, an let go of this wheel]*
17,563,222
I see that one could have several versions of a Python package installed: ``` $ locate signals.py | grep python /usr/lib/pymodules/python2.7/zim/signals.py /usr/lib/pymodules/python2.7/zim/signals.pyc /usr/lib/python2.7/dist-packages/bzrlib/smart/signals.py /usr/lib/python2.7/dist-packages/bzrlib/smart/signals.pyc /us...
2013/07/10
[ "https://Stackoverflow.com/questions/17563222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/343302/" ]
The `__file__` attribute will tell you: ``` >>> from unittest import signals >>> signals.__file__ '/usr/lib/python2.7/unittest/signals.pyc' ``` `.pyc` are compiled files, so the file you actually are looking for in this case it the `/usr/lib/python2.7/unittest/signals.py` file.
I hope I understood correctly, but here's how you find out the location of the module you loaded: ``` shell> python -c 'import jinja2; print jinja2.__file__' /Library/Python/2.7/site-packages/jinja2/__init__.pyc ```
42,618,250
In various educational guides, I have been guided to install Python modules with an easy one-line command entered in the terminal: **pip install whatever** Well, when I type "pip install" it is not found. Elsewhere in Stack Overflow the following instructions have been given: * Use apt-get -- but I am not using linu...
2017/03/06
[ "https://Stackoverflow.com/questions/42618250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1736844/" ]
I would try: ``` pip3.6 install whatever ```
Right, worked it out now. Pip is installed when Python 3.6 is installed - but instead of typing "pip install", you type: ``` pip3.6 install <ModuleYouWant> ``` I guess this is so people can run Python 2.7 and 3.6 simultaneously.. it'd be nice if it were a little more intuitive though, or there were some instruction...
36,428,145
I am using rails 4.2.6 and ruby 2.3 to create an application .The database I am using is postgresql . When I am running the `rails s` and going to localhost:3000 then the error PG::Connection bad is showing . how to fix it ?
2016/04/05
[ "https://Stackoverflow.com/questions/36428145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? when you display such an error, postgresql server is already running. Check PG status; ``` pg_ctl -D /usr/local/var/postgres status ``` Response; ``` pg_ctl: s...
If your postgresql server is running fine, your configuration in rails might be not well set here is an exemple: file in config/database.yml ``` default: &default adapter: postgresql encoding: unicode pool: 5 timeout: 5000 development: <<: *default host: localhost username: your_pg_username password:...
56,948,071
I have a custom requirement where I want to decide if an API can be accessed depending on certain roles. I am using Spring framework. I want to support something like this: ``` 1. (R1 || R2) && (R3 || R4) 2. (R1) || (R2 && R3) ``` where `R` represents a role. `||` and `&&` are logical operators denoting `or` and ...
2019/07/09
[ "https://Stackoverflow.com/questions/56948071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4772633/" ]
You can use method security based on roles with SpEL. ``` @PreAuthorize("hasRole('ROLE_A') or hasRole('ROLE_B')") public void yourMethod() { // ... } ```
I solved the above problem using the following: 1. I used SpEL as provided by Spring. 2. SpEL supports property replacement. Code for replacement: ``` Inventor tesla = new Inventor("Nikola Tesla"); ExpressionParser parser = new SpelExpressionParser(); Expression exp = parser.parseExpression("name == Nikola Tesla"); ...
533,943
I am trying to do some `sed` operation while substituting output. The specific case is the following: with output `Date:080910 111411` I want to only keep `Date:XXXXXX` and filter out the space with the remaining digits. Normally, a `s/Date:[0-9]{6}//g` would do the trick right? But the `Date:080910 111411` output come...
2019/08/05
[ "https://unix.stackexchange.com/questions/533943", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/365578/" ]
* Did you remember to set option `-E` for extended regular expression? Otherwise, you'd need to write `\{6\}` (basic regular expression syntax) * Your `s/Date:[0-9]{6}//g` will delete that part you actually seem to want to keep * If you want to remove the space and following digits, do exactly that: `sed 's/ [0-9]*$//'...
This will only keep `Date:XXXXXX`: ``` echo "Date:080910 111411" | sed 's/ .*//' ``` And this is more strict, and also preserving the start with "Date:": ``` echo "Date:080910 111411" | sed -r 's/^Date:([0-9]{6}) .*$/\1/' ```
219,956
VPN companies tell us you're not safe if you're not using a VPN. What I'm trying to understand is why, as a home user using the internet at large, a VPN into some VPN hosting company and from there out into the internet is any better (security wise) than going out into the internet from my ISP? I understand that if I...
2019/10/21
[ "https://security.stackexchange.com/questions/219956", "https://security.stackexchange.com", "https://security.stackexchange.com/users/55509/" ]
The assumptions here is that the VPN provider is running from a country that are one or more: 1. have more freedom than your own, especially if you live in oppressive or very conservative countries, your local internet provider or government may block content/site to materials that they do not want you to have access...
* Attackers can track your connection while they are in your network. * Your ISP can track your connection. * Also, somehow, attackers can find your IP address and attack you or learn your some informations like location, ISP. So, you I recommend you to use a VPN. You should be careful while choosing a VPN.
219,956
VPN companies tell us you're not safe if you're not using a VPN. What I'm trying to understand is why, as a home user using the internet at large, a VPN into some VPN hosting company and from there out into the internet is any better (security wise) than going out into the internet from my ISP? I understand that if I...
2019/10/21
[ "https://security.stackexchange.com/questions/219956", "https://security.stackexchange.com", "https://security.stackexchange.com/users/55509/" ]
The assumptions here is that the VPN provider is running from a country that are one or more: 1. have more freedom than your own, especially if you live in oppressive or very conservative countries, your local internet provider or government may block content/site to materials that they do not want you to have access...
Most reputed VPN organizations have a "no log" policy and generally will encrypt your traffic. If your ISP was hacked, your data such as Internet history would be directly traceable back to you, which is not the case if you use a VPN to browse the internet. Some countries even take torrenting seriously, so if you're ...
219,956
VPN companies tell us you're not safe if you're not using a VPN. What I'm trying to understand is why, as a home user using the internet at large, a VPN into some VPN hosting company and from there out into the internet is any better (security wise) than going out into the internet from my ISP? I understand that if I...
2019/10/21
[ "https://security.stackexchange.com/questions/219956", "https://security.stackexchange.com", "https://security.stackexchange.com/users/55509/" ]
Most reputed VPN organizations have a "no log" policy and generally will encrypt your traffic. If your ISP was hacked, your data such as Internet history would be directly traceable back to you, which is not the case if you use a VPN to browse the internet. Some countries even take torrenting seriously, so if you're ...
* Attackers can track your connection while they are in your network. * Your ISP can track your connection. * Also, somehow, attackers can find your IP address and attack you or learn your some informations like location, ISP. So, you I recommend you to use a VPN. You should be careful while choosing a VPN.
42,375,396
So everyday, I need to login to a couple different hosts via ssh and run some maintenance commands there in order for the QA team to be able to test my features. I want to use a python script to automate such boring tasks. It would be something like: * ssh host1 * deploy stuff * logout from host1 * ssh host2 * restar...
2017/02/21
[ "https://Stackoverflow.com/questions/42375396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962048/" ]
You can use the following things programmatically: * For low-level SSH automation - [Paramiko](http://www.paramiko.org/) * For somewhat higher-level automation - [Fabric](http://fabfile.org) Alternatively, if your activities are all around automation of typical sysadmin tasks - have a look at orchestration tools: * ...
Could you set up a Cron job or similar on those hosts? That would probably be ideal. If you don't have the permission to set up Cron jobs, I use a library called [paramiko](http://www.paramiko.org/). The code goes like this: ``` ssh = paramiko.SSHClient() ssh.connect(host, port=p, timeout=2) cmd = "ls" stdin, stdout...
42,375,396
So everyday, I need to login to a couple different hosts via ssh and run some maintenance commands there in order for the QA team to be able to test my features. I want to use a python script to automate such boring tasks. It would be something like: * ssh host1 * deploy stuff * logout from host1 * ssh host2 * restar...
2017/02/21
[ "https://Stackoverflow.com/questions/42375396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962048/" ]
Could you set up a Cron job or similar on those hosts? That would probably be ideal. If you don't have the permission to set up Cron jobs, I use a library called [paramiko](http://www.paramiko.org/). The code goes like this: ``` ssh = paramiko.SSHClient() ssh.connect(host, port=p, timeout=2) cmd = "ls" stdin, stdout...
If these manual stuffs is too many, then I may look into some server configuration managements like Ansible. I have done this kinda automation using: 1. Ansible 2. Python Fabric 3. Rake
42,375,396
So everyday, I need to login to a couple different hosts via ssh and run some maintenance commands there in order for the QA team to be able to test my features. I want to use a python script to automate such boring tasks. It would be something like: * ssh host1 * deploy stuff * logout from host1 * ssh host2 * restar...
2017/02/21
[ "https://Stackoverflow.com/questions/42375396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962048/" ]
You can use the following things programmatically: * For low-level SSH automation - [Paramiko](http://www.paramiko.org/) * For somewhat higher-level automation - [Fabric](http://fabfile.org) Alternatively, if your activities are all around automation of typical sysadmin tasks - have a look at orchestration tools: * ...
If these manual stuffs is too many, then I may look into some server configuration managements like Ansible. I have done this kinda automation using: 1. Ansible 2. Python Fabric 3. Rake
3,350,951
I have an interesting programming puzzle for you: You will be given two things: 1. A word containing a list of English words put together, e.g: ``` word = "iamtiredareyou" ``` 2. Possible subsets: ``` subsets = [ 'i', 'a', 'am', 'amt', 'm', 't', 'ti', 'tire', 'tired', 'i', 'ire', 'r', 're', 'red', 'redare'...
2010/07/28
[ "https://Stackoverflow.com/questions/3350951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348663/" ]
Generally, a recursive algorithm would do. Start with checking all subsets against start of a given word, if found — add (append) to found values and recurse with remaining part of the word and current found values. Or if it's an end of the string — print found values. something like that: ``` all=[] def frec(word, v...
Sorry about the lack of programming snippet, but I'd like to suggest dynamic programming. Attack level 1 and level 2 at the same time by giving each word a cost, and adding all the single characters not present as single character high cost words. The problem is then to find the way of splitting the sequence up into wo...
3,350,951
I have an interesting programming puzzle for you: You will be given two things: 1. A word containing a list of English words put together, e.g: ``` word = "iamtiredareyou" ``` 2. Possible subsets: ``` subsets = [ 'i', 'a', 'am', 'amt', 'm', 't', 'ti', 'tire', 'tired', 'i', 'ire', 'r', 're', 'red', 'redare'...
2010/07/28
[ "https://Stackoverflow.com/questions/3350951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348663/" ]
For the Level 1 challenge you could do it [recursively](http://www.google.com/webhp?q=recursion#q=recursion&btnG=Google+Search). Probably not the most efficient solution, but the easiest: ``` word = "iamtiredareyou" subsets = ['i', 'a', 'am', 'amt', 'm', 't', 'ti', 'tire', 'tired', 'i', 'ire', 'r', 're', 'red', 'redar...
Isn't it just the same as finding the permutations, but with some conditions? Like you start the permutation algorithm (a recursive one) you check if the string you already have matches the first X characters of your to find word, if yes you continue the recursion until you find the whole word, otherwise you go back. ...
3,350,951
I have an interesting programming puzzle for you: You will be given two things: 1. A word containing a list of English words put together, e.g: ``` word = "iamtiredareyou" ``` 2. Possible subsets: ``` subsets = [ 'i', 'a', 'am', 'amt', 'm', 't', 'ti', 'tire', 'tired', 'i', 'ire', 'r', 're', 'red', 'redare'...
2010/07/28
[ "https://Stackoverflow.com/questions/3350951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348663/" ]
Sorry about the lack of programming snippet, but I'd like to suggest dynamic programming. Attack level 1 and level 2 at the same time by giving each word a cost, and adding all the single characters not present as single character high cost words. The problem is then to find the way of splitting the sequence up into wo...
Isn't it just the same as finding the permutations, but with some conditions? Like you start the permutation algorithm (a recursive one) you check if the string you already have matches the first X characters of your to find word, if yes you continue the recursion until you find the whole word, otherwise you go back. ...
3,350,951
I have an interesting programming puzzle for you: You will be given two things: 1. A word containing a list of English words put together, e.g: ``` word = "iamtiredareyou" ``` 2. Possible subsets: ``` subsets = [ 'i', 'a', 'am', 'amt', 'm', 't', 'ti', 'tire', 'tired', 'i', 'ire', 'r', 're', 'red', 'redare'...
2010/07/28
[ "https://Stackoverflow.com/questions/3350951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348663/" ]
Generally, a recursive algorithm would do. Start with checking all subsets against start of a given word, if found — add (append) to found values and recurse with remaining part of the word and current found values. Or if it's an end of the string — print found values. something like that: ``` all=[] def frec(word, v...
For the Level 1 challenge you could do it [recursively](http://www.google.com/webhp?q=recursion#q=recursion&btnG=Google+Search). Probably not the most efficient solution, but the easiest: ``` word = "iamtiredareyou" subsets = ['i', 'a', 'am', 'amt', 'm', 't', 'ti', 'tire', 'tired', 'i', 'ire', 'r', 're', 'red', 'redar...
3,350,951
I have an interesting programming puzzle for you: You will be given two things: 1. A word containing a list of English words put together, e.g: ``` word = "iamtiredareyou" ``` 2. Possible subsets: ``` subsets = [ 'i', 'a', 'am', 'amt', 'm', 't', 'ti', 'tire', 'tired', 'i', 'ire', 'r', 're', 'red', 'redare'...
2010/07/28
[ "https://Stackoverflow.com/questions/3350951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348663/" ]
i think you should do your own programming excercises....
Isn't it just the same as finding the permutations, but with some conditions? Like you start the permutation algorithm (a recursive one) you check if the string you already have matches the first X characters of your to find word, if yes you continue the recursion until you find the whole word, otherwise you go back. ...
3,350,951
I have an interesting programming puzzle for you: You will be given two things: 1. A word containing a list of English words put together, e.g: ``` word = "iamtiredareyou" ``` 2. Possible subsets: ``` subsets = [ 'i', 'a', 'am', 'amt', 'm', 't', 'ti', 'tire', 'tired', 'i', 'ire', 'r', 're', 'red', 'redare'...
2010/07/28
[ "https://Stackoverflow.com/questions/3350951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348663/" ]
Generally, a recursive algorithm would do. Start with checking all subsets against start of a given word, if found — add (append) to found values and recurse with remaining part of the word and current found values. Or if it's an end of the string — print found values. something like that: ``` all=[] def frec(word, v...
Here is a recursive, inefficient Java solution: ``` private static void findSolutions(Set<String> fragments, String target, HashSet<String> solution, Collection<Set<String>> solutions) { if (target.isEmpty()) { solutions.add(solution); return; } for (String frag : fragments) { if (...
3,350,951
I have an interesting programming puzzle for you: You will be given two things: 1. A word containing a list of English words put together, e.g: ``` word = "iamtiredareyou" ``` 2. Possible subsets: ``` subsets = [ 'i', 'a', 'am', 'amt', 'm', 't', 'ti', 'tire', 'tired', 'i', 'ire', 'r', 're', 'red', 'redare'...
2010/07/28
[ "https://Stackoverflow.com/questions/3350951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348663/" ]
Generally, a recursive algorithm would do. Start with checking all subsets against start of a given word, if found — add (append) to found values and recurse with remaining part of the word and current found values. Or if it's an end of the string — print found values. something like that: ``` all=[] def frec(word, v...
Isn't it just the same as finding the permutations, but with some conditions? Like you start the permutation algorithm (a recursive one) you check if the string you already have matches the first X characters of your to find word, if yes you continue the recursion until you find the whole word, otherwise you go back. ...
3,350,951
I have an interesting programming puzzle for you: You will be given two things: 1. A word containing a list of English words put together, e.g: ``` word = "iamtiredareyou" ``` 2. Possible subsets: ``` subsets = [ 'i', 'a', 'am', 'amt', 'm', 't', 'ti', 'tire', 'tired', 'i', 'ire', 'r', 're', 'red', 'redare'...
2010/07/28
[ "https://Stackoverflow.com/questions/3350951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348663/" ]
i think you should do your own programming excercises....
Sorry about the lack of programming snippet, but I'd like to suggest dynamic programming. Attack level 1 and level 2 at the same time by giving each word a cost, and adding all the single characters not present as single character high cost words. The problem is then to find the way of splitting the sequence up into wo...
3,350,951
I have an interesting programming puzzle for you: You will be given two things: 1. A word containing a list of English words put together, e.g: ``` word = "iamtiredareyou" ``` 2. Possible subsets: ``` subsets = [ 'i', 'a', 'am', 'amt', 'm', 't', 'ti', 'tire', 'tired', 'i', 'ire', 'r', 're', 'red', 'redare'...
2010/07/28
[ "https://Stackoverflow.com/questions/3350951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348663/" ]
Generally, a recursive algorithm would do. Start with checking all subsets against start of a given word, if found — add (append) to found values and recurse with remaining part of the word and current found values. Or if it's an end of the string — print found values. something like that: ``` all=[] def frec(word, v...
i think you should do your own programming excercises....
3,350,951
I have an interesting programming puzzle for you: You will be given two things: 1. A word containing a list of English words put together, e.g: ``` word = "iamtiredareyou" ``` 2. Possible subsets: ``` subsets = [ 'i', 'a', 'am', 'amt', 'm', 't', 'ti', 'tire', 'tired', 'i', 'ire', 'r', 're', 'red', 'redare'...
2010/07/28
[ "https://Stackoverflow.com/questions/3350951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348663/" ]
i think you should do your own programming excercises....
Here is a recursive, inefficient Java solution: ``` private static void findSolutions(Set<String> fragments, String target, HashSet<String> solution, Collection<Set<String>> solutions) { if (target.isEmpty()) { solutions.add(solution); return; } for (String frag : fragments) { if (...
49,891,950
i have multiple input fields, adding and changing are working fine with that particular fieds, but when coming to error message section, if there is input field eror in one field it is shown in all other fields. But, i want error to display for that particular field. HTML: ``` <md-card-content> <ul class="listClass...
2018/04/18
[ "https://Stackoverflow.com/questions/49891950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7616010/" ]
Take a variable, which stores the `id` of `media` and **display error message accordingly depending on the media ID**. * I m assigning **`this.errorDiv[media._id] = true;;`** so that I can use `errorDiv` in \*ngIf * In HTML I used **`*ngIf="errorMsg[media._id] && (errorDiv[media._id])"`** which checks the error messag...
You can do soething like this. Without doing anything in ts file. You can validate and show validation messages just using form controls. ``` <input id="name" name="name" class="form-control" required minlength="4" appForbiddenName="bob" [(ngModel)]="hero.name" #name="ngModel" > <div *ngIf="name.invalid...
49,891,950
i have multiple input fields, adding and changing are working fine with that particular fieds, but when coming to error message section, if there is input field eror in one field it is shown in all other fields. But, i want error to display for that particular field. HTML: ``` <md-card-content> <ul class="listClass...
2018/04/18
[ "https://Stackoverflow.com/questions/49891950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7616010/" ]
Try binding the error message to each media object separately: HTML: ``` <md-card-content> <ul class="listClass"> <li *ngFor="let media of videos; let i = index "> <div> <input type="text" name="{{media._id}}[i]" id="{{media._id}}[i]" class="form-control form-textbox input-text" [(ngModel)]="media...
You can do soething like this. Without doing anything in ts file. You can validate and show validation messages just using form controls. ``` <input id="name" name="name" class="form-control" required minlength="4" appForbiddenName="bob" [(ngModel)]="hero.name" #name="ngModel" > <div *ngIf="name.invalid...
49,891,950
i have multiple input fields, adding and changing are working fine with that particular fieds, but when coming to error message section, if there is input field eror in one field it is shown in all other fields. But, i want error to display for that particular field. HTML: ``` <md-card-content> <ul class="listClass...
2018/04/18
[ "https://Stackoverflow.com/questions/49891950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7616010/" ]
Take a variable, which stores the `id` of `media` and **display error message accordingly depending on the media ID**. * I m assigning **`this.errorDiv[media._id] = true;;`** so that I can use `errorDiv` in \*ngIf * In HTML I used **`*ngIf="errorMsg[media._id] && (errorDiv[media._id])"`** which checks the error messag...
See the code below and you will realize your mistake. You must add condition that is for the current input only. ``` <div [ngClass]="{ 'has-error': form.submitted && !username.valid }"> <label for="firstName">First Name</label> <input type="text" name="firstName" [(ngModel)]="model.firstName" #f...
49,891,950
i have multiple input fields, adding and changing are working fine with that particular fieds, but when coming to error message section, if there is input field eror in one field it is shown in all other fields. But, i want error to display for that particular field. HTML: ``` <md-card-content> <ul class="listClass...
2018/04/18
[ "https://Stackoverflow.com/questions/49891950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7616010/" ]
Try binding the error message to each media object separately: HTML: ``` <md-card-content> <ul class="listClass"> <li *ngFor="let media of videos; let i = index "> <div> <input type="text" name="{{media._id}}[i]" id="{{media._id}}[i]" class="form-control form-textbox input-text" [(ngModel)]="media...
See the code below and you will realize your mistake. You must add condition that is for the current input only. ``` <div [ngClass]="{ 'has-error': form.submitted && !username.valid }"> <label for="firstName">First Name</label> <input type="text" name="firstName" [(ngModel)]="model.firstName" #f...
49,891,950
i have multiple input fields, adding and changing are working fine with that particular fieds, but when coming to error message section, if there is input field eror in one field it is shown in all other fields. But, i want error to display for that particular field. HTML: ``` <md-card-content> <ul class="listClass...
2018/04/18
[ "https://Stackoverflow.com/questions/49891950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7616010/" ]
Take a variable, which stores the `id` of `media` and **display error message accordingly depending on the media ID**. * I m assigning **`this.errorDiv[media._id] = true;;`** so that I can use `errorDiv` in \*ngIf * In HTML I used **`*ngIf="errorMsg[media._id] && (errorDiv[media._id])"`** which checks the error messag...
Best is you create a custom validator checking your input, you were pointed to the right direction but only very briefly. Create a new directive and provide it in your app module. ``` @Directive({ selector: '[appValidURL]', providers: [{provide: NG_VALIDATORS, useExisting: URLValidatorDirective, multi: true}] ...
49,891,950
i have multiple input fields, adding and changing are working fine with that particular fieds, but when coming to error message section, if there is input field eror in one field it is shown in all other fields. But, i want error to display for that particular field. HTML: ``` <md-card-content> <ul class="listClass...
2018/04/18
[ "https://Stackoverflow.com/questions/49891950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7616010/" ]
Take a variable, which stores the `id` of `media` and **display error message accordingly depending on the media ID**. * I m assigning **`this.errorDiv[media._id] = true;;`** so that I can use `errorDiv` in \*ngIf * In HTML I used **`*ngIf="errorMsg[media._id] && (errorDiv[media._id])"`** which checks the error messag...
Try binding the error message to each media object separately: HTML: ``` <md-card-content> <ul class="listClass"> <li *ngFor="let media of videos; let i = index "> <div> <input type="text" name="{{media._id}}[i]" id="{{media._id}}[i]" class="form-control form-textbox input-text" [(ngModel)]="media...
49,891,950
i have multiple input fields, adding and changing are working fine with that particular fieds, but when coming to error message section, if there is input field eror in one field it is shown in all other fields. But, i want error to display for that particular field. HTML: ``` <md-card-content> <ul class="listClass...
2018/04/18
[ "https://Stackoverflow.com/questions/49891950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7616010/" ]
Try binding the error message to each media object separately: HTML: ``` <md-card-content> <ul class="listClass"> <li *ngFor="let media of videos; let i = index "> <div> <input type="text" name="{{media._id}}[i]" id="{{media._id}}[i]" class="form-control form-textbox input-text" [(ngModel)]="media...
Best is you create a custom validator checking your input, you were pointed to the right direction but only very briefly. Create a new directive and provide it in your app module. ``` @Directive({ selector: '[appValidURL]', providers: [{provide: NG_VALIDATORS, useExisting: URLValidatorDirective, multi: true}] ...
31,698,041
For some unknown reason, I can't edit files in Android Studio. This includes both Java and XML files. When I launch Android Studio (v1.2.2), everything is fine. However, after some time, I lose the ability to edit files content. Here is what I noticed: * When I click on any line in the source code, the lines get high...
2015/07/29
[ "https://Stackoverflow.com/questions/31698041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543711/" ]
Permanent Fix for Can't Edit Files in Android Studio On Windows. Performing the following steps: 1. Close Android studio. 2. Go to your User Folder - on Windows 7/8 this would be: [SYSDRIVE]:\Users[your username] (ex. C:\Users\Venky) In this folder there should be a folder called .AndroidStudioBeta or .AndroidStudio...
1- Close Android Studio. 2 - Remove .idea folder from your project 3 - Start Android Studio and open project.
31,698,041
For some unknown reason, I can't edit files in Android Studio. This includes both Java and XML files. When I launch Android Studio (v1.2.2), everything is fine. However, after some time, I lose the ability to edit files content. Here is what I noticed: * When I click on any line in the source code, the lines get high...
2015/07/29
[ "https://Stackoverflow.com/questions/31698041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543711/" ]
I have faced same problem and tried some of the solutions above. None of worked for me. After `File` -> `Invalidate Caches/Restart` the problem have been solved.
Permanent Fix for Can't Edit Files in Android Studio On Windows. Performing the following steps: 1. Close Android studio. 2. Go to your User Folder - on Windows 7/8 this would be: [SYSDRIVE]:\Users[your username] (ex. C:\Users\Venky) In this folder there should be a folder called .AndroidStudioBeta or .AndroidStudio...
31,698,041
For some unknown reason, I can't edit files in Android Studio. This includes both Java and XML files. When I launch Android Studio (v1.2.2), everything is fine. However, after some time, I lose the ability to edit files content. Here is what I noticed: * When I click on any line in the source code, the lines get high...
2015/07/29
[ "https://Stackoverflow.com/questions/31698041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543711/" ]
**TL;DR:** to fix it on OSX run in the terminal: ``` defaults write -g ApplePressAndHoldEnabled -bool false ``` **Details:** I had this issue for years on OSX in Android Studio and in all the other Intellij Based apps (AppCode, WebStorm, IntelliJ Idea, etc): after some time the editor loses focus and it's not possi...
The only solution that worked with me: 1. Close Android Studio. 2. Save .idea folder for future restore (if something happened). 3. Remove .idea folder (or just rename it). 4. Start Android Studio and open project.
31,698,041
For some unknown reason, I can't edit files in Android Studio. This includes both Java and XML files. When I launch Android Studio (v1.2.2), everything is fine. However, after some time, I lose the ability to edit files content. Here is what I noticed: * When I click on any line in the source code, the lines get high...
2015/07/29
[ "https://Stackoverflow.com/questions/31698041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543711/" ]
click on vertical scroll bar area to get focus in project view [![click on vertical scroll bar area to get focus in project view](https://i.stack.imgur.com/jFlPY.png)](https://i.stack.imgur.com/jFlPY.png)
This's because of ideaVim for my case. And you can switch from this mode (uneditable) by clicking "i" on your keyboard. To get more information about ideaVim : <https://www.jetbrains.com/help/pycharm/using-product-as-the-vim-editor.html#vimrc>
31,698,041
For some unknown reason, I can't edit files in Android Studio. This includes both Java and XML files. When I launch Android Studio (v1.2.2), everything is fine. However, after some time, I lose the ability to edit files content. Here is what I noticed: * When I click on any line in the source code, the lines get high...
2015/07/29
[ "https://Stackoverflow.com/questions/31698041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543711/" ]
tl;dr, open the search with cmd + shift + f and close it again. All should be good. --- I was also having the problem of suddenly losing the ability to type in the editor on my mac. There was never any rhyme or reason. I tried the suggestions here and sadly they didn't work. What worked for me is opening the search...
This's because of ideaVim for my case. And you can switch from this mode (uneditable) by clicking "i" on your keyboard. To get more information about ideaVim : <https://www.jetbrains.com/help/pycharm/using-product-as-the-vim-editor.html#vimrc>
31,698,041
For some unknown reason, I can't edit files in Android Studio. This includes both Java and XML files. When I launch Android Studio (v1.2.2), everything is fine. However, after some time, I lose the ability to edit files content. Here is what I noticed: * When I click on any line in the source code, the lines get high...
2015/07/29
[ "https://Stackoverflow.com/questions/31698041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543711/" ]
This's because of ideaVim for my case. And you can switch from this mode (uneditable) by clicking "i" on your keyboard. To get more information about ideaVim : <https://www.jetbrains.com/help/pycharm/using-product-as-the-vim-editor.html#vimrc>
uninstall IdeaVIM solved my problem. Android studio> Preferences > Plugins > IdeaVim (uninstall)
31,698,041
For some unknown reason, I can't edit files in Android Studio. This includes both Java and XML files. When I launch Android Studio (v1.2.2), everything is fine. However, after some time, I lose the ability to edit files content. Here is what I noticed: * When I click on any line in the source code, the lines get high...
2015/07/29
[ "https://Stackoverflow.com/questions/31698041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543711/" ]
**TL;DR:** to fix it on OSX run in the terminal: ``` defaults write -g ApplePressAndHoldEnabled -bool false ``` **Details:** I had this issue for years on OSX in Android Studio and in all the other Intellij Based apps (AppCode, WebStorm, IntelliJ Idea, etc): after some time the editor loses focus and it's not possi...
Yes Thanks it is definitely the VIM Emulator. Disable it from the tool menu and you will not loose the ability anymore
31,698,041
For some unknown reason, I can't edit files in Android Studio. This includes both Java and XML files. When I launch Android Studio (v1.2.2), everything is fine. However, after some time, I lose the ability to edit files content. Here is what I noticed: * When I click on any line in the source code, the lines get high...
2015/07/29
[ "https://Stackoverflow.com/questions/31698041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543711/" ]
tl;dr, open the search with cmd + shift + f and close it again. All should be good. --- I was also having the problem of suddenly losing the ability to type in the editor on my mac. There was never any rhyme or reason. I tried the suggestions here and sadly they didn't work. What worked for me is opening the search...
i was facing same problem in project. i was change the time of my computer which cause this error. so after invalidate caches and restart studio , it works fine.
31,698,041
For some unknown reason, I can't edit files in Android Studio. This includes both Java and XML files. When I launch Android Studio (v1.2.2), everything is fine. However, after some time, I lose the ability to edit files content. Here is what I noticed: * When I click on any line in the source code, the lines get high...
2015/07/29
[ "https://Stackoverflow.com/questions/31698041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543711/" ]
I have faced same problem and tried some of the solutions above. None of worked for me. After `File` -> `Invalidate Caches/Restart` the problem have been solved.
This's because of ideaVim for my case. And you can switch from this mode (uneditable) by clicking "i" on your keyboard. To get more information about ideaVim : <https://www.jetbrains.com/help/pycharm/using-product-as-the-vim-editor.html#vimrc>
31,698,041
For some unknown reason, I can't edit files in Android Studio. This includes both Java and XML files. When I launch Android Studio (v1.2.2), everything is fine. However, after some time, I lose the ability to edit files content. Here is what I noticed: * When I click on any line in the source code, the lines get high...
2015/07/29
[ "https://Stackoverflow.com/questions/31698041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543711/" ]
I have faced same problem and tried some of the solutions above. None of worked for me. After `File` -> `Invalidate Caches/Restart` the problem have been solved.
your file system maybe in read only move your project to another folder or drive [![enter image description here](https://i.stack.imgur.com/Kn8UU.jpg)](https://i.stack.imgur.com/Kn8UU.jpg)
31,309,585
I am new to a lot of the ASP.net MVC5 features. I wanted to know if there as a library that would automatically add the escape characters to a C# string that's intended to be output as html? Would HTMLAgility Pack be what I am looking for? Or is there soemthing built in that does it for you? May someone please let me k...
2015/07/09
[ "https://Stackoverflow.com/questions/31309585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1159482/" ]
``` System.Web.HttpUtility.HtmlEncode("<p>I am some html</p>"); ```
Output string to html, you can try to use [HttpServerUtility.HtmlEncode](https://msdn.microsoft.com/en-us/library/w3te6wfz(v=vs.110).aspx)
27,894,051
I have a SharpDX project that is very near completion. It uses a Kinect for interaction. Because of this my project uses WPF both for the Kinect region and the KinectUserViewer object. SharpDX has worked great for everything so far, however, when it gets to a certain part of the program that uses direct3D heavily, it b...
2015/01/12
[ "https://Stackoverflow.com/questions/27894051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4400722/" ]
Flickering likely indicates that the GPU is not finished rendering the frame before you D3DImage tries to copy it to its front buffer. This can easily happen in WPF because WPF doesn't use the standard mechanism of presenting to a swap chain to render a frame. Instead, most code uses something like the following: ``` ...
I had the same problem, `DeviceCreationFlags.SingleThreaded` helped me.
27,894,051
I have a SharpDX project that is very near completion. It uses a Kinect for interaction. Because of this my project uses WPF both for the Kinect region and the KinectUserViewer object. SharpDX has worked great for everything so far, however, when it gets to a certain part of the program that uses direct3D heavily, it b...
2015/01/12
[ "https://Stackoverflow.com/questions/27894051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4400722/" ]
Flickering likely indicates that the GPU is not finished rendering the frame before you D3DImage tries to copy it to its front buffer. This can easily happen in WPF because WPF doesn't use the standard mechanism of presenting to a swap chain to render a frame. Instead, most code uses something like the following: ``` ...
The problem is not the Locking mechanism. Normally you use `Present` to draw to present the image. `Present` will wait until all drawing is ready. With D3DImage you are not using the `Present()` method. Instead of Presenting, you lock, adding a DirtyRect and unlock the `D3DImage`. The rendering is done asynchrone so ...
27,894,051
I have a SharpDX project that is very near completion. It uses a Kinect for interaction. Because of this my project uses WPF both for the Kinect region and the KinectUserViewer object. SharpDX has worked great for everything so far, however, when it gets to a certain part of the program that uses direct3D heavily, it b...
2015/01/12
[ "https://Stackoverflow.com/questions/27894051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4400722/" ]
Flickering likely indicates that the GPU is not finished rendering the frame before you D3DImage tries to copy it to its front buffer. This can easily happen in WPF because WPF doesn't use the standard mechanism of presenting to a swap chain to render a frame. Instead, most code uses something like the following: ``` ...
Finally I solve this problem: <https://learn.microsoft.com/zh-cn/windows/win32/api/d3d11/nn-d3d11-id3d11query> ``` public void Render() { ThrowIfDisposed(); if (RenderTarget == null) { throw new InvalidOperationException("Resize has not been called."); } D3D10.Query query = new D3D10.Query(...
27,894,051
I have a SharpDX project that is very near completion. It uses a Kinect for interaction. Because of this my project uses WPF both for the Kinect region and the KinectUserViewer object. SharpDX has worked great for everything so far, however, when it gets to a certain part of the program that uses direct3D heavily, it b...
2015/01/12
[ "https://Stackoverflow.com/questions/27894051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4400722/" ]
The problem is not the Locking mechanism. Normally you use `Present` to draw to present the image. `Present` will wait until all drawing is ready. With D3DImage you are not using the `Present()` method. Instead of Presenting, you lock, adding a DirtyRect and unlock the `D3DImage`. The rendering is done asynchrone so ...
I had the same problem, `DeviceCreationFlags.SingleThreaded` helped me.
27,894,051
I have a SharpDX project that is very near completion. It uses a Kinect for interaction. Because of this my project uses WPF both for the Kinect region and the KinectUserViewer object. SharpDX has worked great for everything so far, however, when it gets to a certain part of the program that uses direct3D heavily, it b...
2015/01/12
[ "https://Stackoverflow.com/questions/27894051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4400722/" ]
I had the same problem, `DeviceCreationFlags.SingleThreaded` helped me.
Finally I solve this problem: <https://learn.microsoft.com/zh-cn/windows/win32/api/d3d11/nn-d3d11-id3d11query> ``` public void Render() { ThrowIfDisposed(); if (RenderTarget == null) { throw new InvalidOperationException("Resize has not been called."); } D3D10.Query query = new D3D10.Query(...
27,894,051
I have a SharpDX project that is very near completion. It uses a Kinect for interaction. Because of this my project uses WPF both for the Kinect region and the KinectUserViewer object. SharpDX has worked great for everything so far, however, when it gets to a certain part of the program that uses direct3D heavily, it b...
2015/01/12
[ "https://Stackoverflow.com/questions/27894051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4400722/" ]
The problem is not the Locking mechanism. Normally you use `Present` to draw to present the image. `Present` will wait until all drawing is ready. With D3DImage you are not using the `Present()` method. Instead of Presenting, you lock, adding a DirtyRect and unlock the `D3DImage`. The rendering is done asynchrone so ...
Finally I solve this problem: <https://learn.microsoft.com/zh-cn/windows/win32/api/d3d11/nn-d3d11-id3d11query> ``` public void Render() { ThrowIfDisposed(); if (RenderTarget == null) { throw new InvalidOperationException("Resize has not been called."); } D3D10.Query query = new D3D10.Query(...
12,246,942
I'm learning the Basics of Android programming. I have a simple android test application in which i log the accelerometer,magnetometer and the orientation data to an external file while also displaying it. I initiate the logging process on click of a **Start** button (registerListener for relevant sensors) by calling ...
2012/09/03
[ "https://Stackoverflow.com/questions/12246942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190467/" ]
You can change the interval by changing the delay when registering for the sensor. ``` int SENSOR_DELAY_FASTEST get sensor data as fast as possible int SENSOR_DELAY_GAME rate suitable for games int SENSOR_DELAY_NORMAL rate (default) suitable for screen orientation changes int SENSOR_DELAY_UI rat...
When registering your Listener with the `SensorManager` using [registerListener](http://developer.android.com/reference/android/hardware/SensorManager.html#registerListener%28android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int%29), instead of the fixed constants `SENSOR_DELAY_...` you can **pass the ...
12,246,942
I'm learning the Basics of Android programming. I have a simple android test application in which i log the accelerometer,magnetometer and the orientation data to an external file while also displaying it. I initiate the logging process on click of a **Start** button (registerListener for relevant sensors) by calling ...
2012/09/03
[ "https://Stackoverflow.com/questions/12246942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190467/" ]
Since you know that if there was no SensorChanged Event fired, there was no change, you can just use your old value. As you asked for LOG data in specific intervals, i would not do any output in the onSensorChanged Method just clone the new data to your accelerometerdata variable. And than log the value of accelerome...
You can change the interval by changing the delay when registering for the sensor. ``` int SENSOR_DELAY_FASTEST get sensor data as fast as possible int SENSOR_DELAY_GAME rate suitable for games int SENSOR_DELAY_NORMAL rate (default) suitable for screen orientation changes int SENSOR_DELAY_UI rat...
12,246,942
I'm learning the Basics of Android programming. I have a simple android test application in which i log the accelerometer,magnetometer and the orientation data to an external file while also displaying it. I initiate the logging process on click of a **Start** button (registerListener for relevant sensors) by calling ...
2012/09/03
[ "https://Stackoverflow.com/questions/12246942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190467/" ]
You can change the interval by changing the delay when registering for the sensor. ``` int SENSOR_DELAY_FASTEST get sensor data as fast as possible int SENSOR_DELAY_GAME rate suitable for games int SENSOR_DELAY_NORMAL rate (default) suitable for screen orientation changes int SENSOR_DELAY_UI rat...
I have been trying to figure out how can I have very long delays with sensors, and so far I have been successful. The documentation on the developer.android talks that the delay time can be specified in microseconds, below is a large number I tried: ``` // Initialize in onCreate mSensorManager = (SensorManager) getSys...
12,246,942
I'm learning the Basics of Android programming. I have a simple android test application in which i log the accelerometer,magnetometer and the orientation data to an external file while also displaying it. I initiate the logging process on click of a **Start** button (registerListener for relevant sensors) by calling ...
2012/09/03
[ "https://Stackoverflow.com/questions/12246942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190467/" ]
You can change the interval by changing the delay when registering for the sensor. ``` int SENSOR_DELAY_FASTEST get sensor data as fast as possible int SENSOR_DELAY_GAME rate suitable for games int SENSOR_DELAY_NORMAL rate (default) suitable for screen orientation changes int SENSOR_DELAY_UI rat...
It seems that the rate at which onSensorChanged is called has to be one of the 4 suggested values. What you can do for 'slow reads' is use SENSOR\_DELAY\_UI and (in onSensorChanged) measure the time that has passed since the last time you read the sensordata: ``` long lastUpdate = System.currentTimeMillis(); // In o...
12,246,942
I'm learning the Basics of Android programming. I have a simple android test application in which i log the accelerometer,magnetometer and the orientation data to an external file while also displaying it. I initiate the logging process on click of a **Start** button (registerListener for relevant sensors) by calling ...
2012/09/03
[ "https://Stackoverflow.com/questions/12246942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190467/" ]
Since you know that if there was no SensorChanged Event fired, there was no change, you can just use your old value. As you asked for LOG data in specific intervals, i would not do any output in the onSensorChanged Method just clone the new data to your accelerometerdata variable. And than log the value of accelerome...
When registering your Listener with the `SensorManager` using [registerListener](http://developer.android.com/reference/android/hardware/SensorManager.html#registerListener%28android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int%29), instead of the fixed constants `SENSOR_DELAY_...` you can **pass the ...
12,246,942
I'm learning the Basics of Android programming. I have a simple android test application in which i log the accelerometer,magnetometer and the orientation data to an external file while also displaying it. I initiate the logging process on click of a **Start** button (registerListener for relevant sensors) by calling ...
2012/09/03
[ "https://Stackoverflow.com/questions/12246942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190467/" ]
When registering your Listener with the `SensorManager` using [registerListener](http://developer.android.com/reference/android/hardware/SensorManager.html#registerListener%28android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int%29), instead of the fixed constants `SENSOR_DELAY_...` you can **pass the ...
I have been trying to figure out how can I have very long delays with sensors, and so far I have been successful. The documentation on the developer.android talks that the delay time can be specified in microseconds, below is a large number I tried: ``` // Initialize in onCreate mSensorManager = (SensorManager) getSys...
12,246,942
I'm learning the Basics of Android programming. I have a simple android test application in which i log the accelerometer,magnetometer and the orientation data to an external file while also displaying it. I initiate the logging process on click of a **Start** button (registerListener for relevant sensors) by calling ...
2012/09/03
[ "https://Stackoverflow.com/questions/12246942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190467/" ]
When registering your Listener with the `SensorManager` using [registerListener](http://developer.android.com/reference/android/hardware/SensorManager.html#registerListener%28android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int%29), instead of the fixed constants `SENSOR_DELAY_...` you can **pass the ...
It seems that the rate at which onSensorChanged is called has to be one of the 4 suggested values. What you can do for 'slow reads' is use SENSOR\_DELAY\_UI and (in onSensorChanged) measure the time that has passed since the last time you read the sensordata: ``` long lastUpdate = System.currentTimeMillis(); // In o...
12,246,942
I'm learning the Basics of Android programming. I have a simple android test application in which i log the accelerometer,magnetometer and the orientation data to an external file while also displaying it. I initiate the logging process on click of a **Start** button (registerListener for relevant sensors) by calling ...
2012/09/03
[ "https://Stackoverflow.com/questions/12246942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190467/" ]
Since you know that if there was no SensorChanged Event fired, there was no change, you can just use your old value. As you asked for LOG data in specific intervals, i would not do any output in the onSensorChanged Method just clone the new data to your accelerometerdata variable. And than log the value of accelerome...
I have been trying to figure out how can I have very long delays with sensors, and so far I have been successful. The documentation on the developer.android talks that the delay time can be specified in microseconds, below is a large number I tried: ``` // Initialize in onCreate mSensorManager = (SensorManager) getSys...
12,246,942
I'm learning the Basics of Android programming. I have a simple android test application in which i log the accelerometer,magnetometer and the orientation data to an external file while also displaying it. I initiate the logging process on click of a **Start** button (registerListener for relevant sensors) by calling ...
2012/09/03
[ "https://Stackoverflow.com/questions/12246942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190467/" ]
Since you know that if there was no SensorChanged Event fired, there was no change, you can just use your old value. As you asked for LOG data in specific intervals, i would not do any output in the onSensorChanged Method just clone the new data to your accelerometerdata variable. And than log the value of accelerome...
It seems that the rate at which onSensorChanged is called has to be one of the 4 suggested values. What you can do for 'slow reads' is use SENSOR\_DELAY\_UI and (in onSensorChanged) measure the time that has passed since the last time you read the sensordata: ``` long lastUpdate = System.currentTimeMillis(); // In o...
36,109,168
So I'm trying to convert one of my Android apps to iOS. In android we just have a drawable folder to store Images in. I'm pretty new to iOS and xCode and I was trying to find something similar here, however I didn't so I simply created an images folder and added all my resources to it. I added a button and set the back...
2016/03/20
[ "https://Stackoverflow.com/questions/36109168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4909000/" ]
The problem is that you created, as you say, an images *folder*. What you should have done is to create an images *group* in project navigator (choose New > Group) and drag your images from the Finder into that group in the project navigator. The reason this works is that the group is just virtual. Thus the images the...
because you haven't add the Images folder to the targets,you can move the Images folder to Assets.xcassets.
50,181,166
I'm using C# wpf and want to take a camera picture and then after completion event call - change some controls in MainWindow. The issue is event is called in different thread than main one, and in order to run my NextState function (changing some controls) it needs to be the main thread (otherwise i get message box wit...
2018/05/04
[ "https://Stackoverflow.com/questions/50181166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5768052/" ]
A background thread that is spun off from the main UI thread cannot update the contents of the element that was created on the UI thread. In order for the background thread to access the property of the UI, the background thread must delegate the work to the Dispatcher associated with the UI thread. In your `Timer_El...
You are correct, it's executed on a different thread. You could invoke the `NextState()` method on the main thread using the `Dispatcher`. ``` Dispatcher.Invoke(() = > NextState()); ```
4,238,191
I am trying to solve the following problem: --- Let $I \subset \mathbb{R}$ be an open interval that contains $0$ and $f:I \to \mathbb{R}$ be a function defined as: $$f(x)=\inf \{\alpha >0 : \alpha^{-1}x\in I\}$$ Show that: * $f(cx)=cf(x)$ for all $c>0$; * $I =\{x \in \mathbb{R}:f(x)<1\}$; * There exists $K>0$ such...
2021/09/01
[ "https://math.stackexchange.com/questions/4238191", "https://math.stackexchange.com", "https://math.stackexchange.com/users/25805/" ]
With respect to the last part: > > There exists $K>0$ such that $0\leq f(x)\leq K|x|$. > > > $f(x) \ge0$ should be obvious. Also $f(0) = 0$ so that it suffices to consider the case $x \ne 0$. Choose $K > 0$ such that $1/K \in I$ and $-1/K \in I$. Then $$ \left| \left(K |x| \right)^{-1} x\right| = \frac 1 K \impl...
Notice that $I$ is an open interval containing $0$ so it is of the form $I=(a,b)$ with $a<0$ and $b>0$ * $f(cx)=\inf \{\alpha >0 : \alpha^{-1}cx\in I\}=c\inf \{\alpha >0 : \alpha^{-1}x\in I\}=cf(x)$ * Let us prove this in two parts: If $x\in I$ then $f(x)\leq1$ (since, if $\alpha=1$ we have $\alpha^{-1}x=x\in I$). No...
54,538,283
Got some troubles with Lazy Loading. All urls shows me empty pages. Structure: ``` - app.module.ts - modules - router.module.ts - scenes - dashboard - dashboard.module.ts - router.module.ts ``` I have ``` imports: [ RoutingModule, ] ``` in **app.module.ts** **routing.module.ts:** ``` imp...
2019/02/05
[ "https://Stackoverflow.com/questions/54538283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6226725/" ]
One way to (try to) deal with buffering is to set up a terminal-like environment for the process, a pseudo-terminal (pty). That is not easy to do in general but [IPC::Run](https://metacpan.org/pod/IPC::Run) has that capability ready for easy use. Here is the driver, run for testing using [at](https://man7.org/linux/ma...
Unfortunately Perl has no control over the buffering behavior of the programs it executes. Some systems have an [`unbuffer`](http://manpages.ubuntu.com/manpages/cosmic/en/man1/expect_unbuffer.1.html) utility that can do this. If you have access to this tool, you could say ``` my $pid = open2($out, $in, 'unbuffer ./chi...
31,438,286
I am learning about DDD so apologies if my question is naive. I think I need to use Local Data Transfer Object in order to display data to the users as a lot of properties are not part of any of Entity / Value Objects. However, I am not sure where this DTO should be implemented - in a Domain Layer or in an Applicatio...
2015/07/15
[ "https://Stackoverflow.com/questions/31438286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105030/" ]
Define the DTO to the layer where the source of the values comes from. **Relative to OP's question:** place the DTO in the **Application Service Layer**. DTO is an output of that layer, it makes sense if you define it there. Don't put your DTO in the Domain Layer. The Domain Layer does not care about mapping things to...
Yorro is right about where to place DTO but I encourage you to avoid "DTO mindset". This way of thinking collides with DDD way of thinking. Thinking about "I need a DTO here" is thinking about technical representation (as plalx says); it is a level of abstraction too low. Try a higer level of abtraction and think abou...
31,438,286
I am learning about DDD so apologies if my question is naive. I think I need to use Local Data Transfer Object in order to display data to the users as a lot of properties are not part of any of Entity / Value Objects. However, I am not sure where this DTO should be implemented - in a Domain Layer or in an Applicatio...
2015/07/15
[ "https://Stackoverflow.com/questions/31438286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105030/" ]
Define the DTO to the layer where the source of the values comes from. **Relative to OP's question:** place the DTO in the **Application Service Layer**. DTO is an output of that layer, it makes sense if you define it there. Don't put your DTO in the Domain Layer. The Domain Layer does not care about mapping things to...
DTO and Domain are different layers. So it requires mapping from one to another and usually it is done in what is called Application Services layer. Take a look at the following articles to go deeper with DTO and layering: * [Is Layering Worth the Mapping? by Mark Seemann](http://blog.ploeh.dk/2012/02/09/IsLayer...
31,438,286
I am learning about DDD so apologies if my question is naive. I think I need to use Local Data Transfer Object in order to display data to the users as a lot of properties are not part of any of Entity / Value Objects. However, I am not sure where this DTO should be implemented - in a Domain Layer or in an Applicatio...
2015/07/15
[ "https://Stackoverflow.com/questions/31438286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105030/" ]
Define the DTO to the layer where the source of the values comes from. **Relative to OP's question:** place the DTO in the **Application Service Layer**. DTO is an output of that layer, it makes sense if you define it there. Don't put your DTO in the Domain Layer. The Domain Layer does not care about mapping things to...
Such DTOs that are exposed to the outside world become part of a contract. Depending on their form, a good place for them is either the Application Layer or the Presentation Layer. If the DTOs are only for presentation purposes, then the Presentation Layer is a good choice. If they are part of an API, be it for input...
31,438,286
I am learning about DDD so apologies if my question is naive. I think I need to use Local Data Transfer Object in order to display data to the users as a lot of properties are not part of any of Entity / Value Objects. However, I am not sure where this DTO should be implemented - in a Domain Layer or in an Applicatio...
2015/07/15
[ "https://Stackoverflow.com/questions/31438286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105030/" ]
Define the DTO to the layer where the source of the values comes from. **Relative to OP's question:** place the DTO in the **Application Service Layer**. DTO is an output of that layer, it makes sense if you define it there. Don't put your DTO in the Domain Layer. The Domain Layer does not care about mapping things to...
**Hexagonal (Ports/Adapters) Architecture** What has to be mentioned here is so-called Hexagonal (Ports/Adapters) Architecture [Vernon, the red book p. 125]. It is very convenient to place objects that represent data for the external (outside the domain & the application) comsumers. The architecture is the great addit...
31,438,286
I am learning about DDD so apologies if my question is naive. I think I need to use Local Data Transfer Object in order to display data to the users as a lot of properties are not part of any of Entity / Value Objects. However, I am not sure where this DTO should be implemented - in a Domain Layer or in an Applicatio...
2015/07/15
[ "https://Stackoverflow.com/questions/31438286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105030/" ]
Such DTOs that are exposed to the outside world become part of a contract. Depending on their form, a good place for them is either the Application Layer or the Presentation Layer. If the DTOs are only for presentation purposes, then the Presentation Layer is a good choice. If they are part of an API, be it for input...
Yorro is right about where to place DTO but I encourage you to avoid "DTO mindset". This way of thinking collides with DDD way of thinking. Thinking about "I need a DTO here" is thinking about technical representation (as plalx says); it is a level of abstraction too low. Try a higer level of abtraction and think abou...
31,438,286
I am learning about DDD so apologies if my question is naive. I think I need to use Local Data Transfer Object in order to display data to the users as a lot of properties are not part of any of Entity / Value Objects. However, I am not sure where this DTO should be implemented - in a Domain Layer or in an Applicatio...
2015/07/15
[ "https://Stackoverflow.com/questions/31438286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105030/" ]
Yorro is right about where to place DTO but I encourage you to avoid "DTO mindset". This way of thinking collides with DDD way of thinking. Thinking about "I need a DTO here" is thinking about technical representation (as plalx says); it is a level of abstraction too low. Try a higer level of abtraction and think abou...
**Hexagonal (Ports/Adapters) Architecture** What has to be mentioned here is so-called Hexagonal (Ports/Adapters) Architecture [Vernon, the red book p. 125]. It is very convenient to place objects that represent data for the external (outside the domain & the application) comsumers. The architecture is the great addit...
31,438,286
I am learning about DDD so apologies if my question is naive. I think I need to use Local Data Transfer Object in order to display data to the users as a lot of properties are not part of any of Entity / Value Objects. However, I am not sure where this DTO should be implemented - in a Domain Layer or in an Applicatio...
2015/07/15
[ "https://Stackoverflow.com/questions/31438286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105030/" ]
Such DTOs that are exposed to the outside world become part of a contract. Depending on their form, a good place for them is either the Application Layer or the Presentation Layer. If the DTOs are only for presentation purposes, then the Presentation Layer is a good choice. If they are part of an API, be it for input...
DTO and Domain are different layers. So it requires mapping from one to another and usually it is done in what is called Application Services layer. Take a look at the following articles to go deeper with DTO and layering: * [Is Layering Worth the Mapping? by Mark Seemann](http://blog.ploeh.dk/2012/02/09/IsLayer...
31,438,286
I am learning about DDD so apologies if my question is naive. I think I need to use Local Data Transfer Object in order to display data to the users as a lot of properties are not part of any of Entity / Value Objects. However, I am not sure where this DTO should be implemented - in a Domain Layer or in an Applicatio...
2015/07/15
[ "https://Stackoverflow.com/questions/31438286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105030/" ]
DTO and Domain are different layers. So it requires mapping from one to another and usually it is done in what is called Application Services layer. Take a look at the following articles to go deeper with DTO and layering: * [Is Layering Worth the Mapping? by Mark Seemann](http://blog.ploeh.dk/2012/02/09/IsLayer...
**Hexagonal (Ports/Adapters) Architecture** What has to be mentioned here is so-called Hexagonal (Ports/Adapters) Architecture [Vernon, the red book p. 125]. It is very convenient to place objects that represent data for the external (outside the domain & the application) comsumers. The architecture is the great addit...
31,438,286
I am learning about DDD so apologies if my question is naive. I think I need to use Local Data Transfer Object in order to display data to the users as a lot of properties are not part of any of Entity / Value Objects. However, I am not sure where this DTO should be implemented - in a Domain Layer or in an Applicatio...
2015/07/15
[ "https://Stackoverflow.com/questions/31438286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105030/" ]
Such DTOs that are exposed to the outside world become part of a contract. Depending on their form, a good place for them is either the Application Layer or the Presentation Layer. If the DTOs are only for presentation purposes, then the Presentation Layer is a good choice. If they are part of an API, be it for input...
**Hexagonal (Ports/Adapters) Architecture** What has to be mentioned here is so-called Hexagonal (Ports/Adapters) Architecture [Vernon, the red book p. 125]. It is very convenient to place objects that represent data for the external (outside the domain & the application) comsumers. The architecture is the great addit...
42,825,211
I am trying to ask the user permission to access their location. This is my MainActivity but permission is not being asked when I run the app. I have entered the code for permissions at the end of the activity. What am I doing wrong? ``` package com.example.googlemapsadding; import android.content.pm.PackageManager; ...
2017/03/16
[ "https://Stackoverflow.com/questions/42825211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7674177/" ]
I think you should request GRANTED with ALL LOCATION PERMISSION ``` String mPerms[] = new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}; ... if (checkSelfPermission(mPerms[0]) == PackageManager.PERMISSION_DENIED || checkSelfPermission(mPerms[1]) == P...
Try [Google Utilities](https://github.com/abhishek-tm/google-utilities) library to get location easily with permission.. ``` locationHandler = new LocationHandler(this) .setLocationListener(new LocationListener() { @Override public void onLocationChanged(Location location) { // Get the best known l...
42,825,211
I am trying to ask the user permission to access their location. This is my MainActivity but permission is not being asked when I run the app. I have entered the code for permissions at the end of the activity. What am I doing wrong? ``` package com.example.googlemapsadding; import android.content.pm.PackageManager; ...
2017/03/16
[ "https://Stackoverflow.com/questions/42825211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7674177/" ]
Solved. I completely erased my permission code and followed this tutorial from scratch - <https://www.youtube.com/watch?v=z2JaVke71RY>. Worked perfectly.
Try [Google Utilities](https://github.com/abhishek-tm/google-utilities) library to get location easily with permission.. ``` locationHandler = new LocationHandler(this) .setLocationListener(new LocationListener() { @Override public void onLocationChanged(Location location) { // Get the best known l...
42,825,211
I am trying to ask the user permission to access their location. This is my MainActivity but permission is not being asked when I run the app. I have entered the code for permissions at the end of the activity. What am I doing wrong? ``` package com.example.googlemapsadding; import android.content.pm.PackageManager; ...
2017/03/16
[ "https://Stackoverflow.com/questions/42825211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7674177/" ]
I think you should request GRANTED with ALL LOCATION PERMISSION ``` String mPerms[] = new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}; ... if (checkSelfPermission(mPerms[0]) == PackageManager.PERMISSION_DENIED || checkSelfPermission(mPerms[1]) == P...
check the target version in your `build.gradle` file, it should be 23 or higher.
42,825,211
I am trying to ask the user permission to access their location. This is my MainActivity but permission is not being asked when I run the app. I have entered the code for permissions at the end of the activity. What am I doing wrong? ``` package com.example.googlemapsadding; import android.content.pm.PackageManager; ...
2017/03/16
[ "https://Stackoverflow.com/questions/42825211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7674177/" ]
Solved. I completely erased my permission code and followed this tutorial from scratch - <https://www.youtube.com/watch?v=z2JaVke71RY>. Worked perfectly.
check the target version in your `build.gradle` file, it should be 23 or higher.
31,779,480
Hi I am writing a method for a larger program but I keep getting the error that symbol cannot be found. please help! ``` public static int maxInc (char []ch) { int current = 1; int max = 1; if (ch.length == 0) { return 0; } else if (ch.length == 1) { return 1; } else { for (int i ...
2015/08/03
[ "https://Stackoverflow.com/questions/31779480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5184197/" ]
There is a semi colon in this line : ``` for (int i = 1; i < ch.length; i++); ``` Remove it and make the line as below: ``` for (int i = 1; i < ch.length; i++) ``` While there is a semicolon what is happening that the loop happen while nothing was done. It became just a statement. This below code was happening li...
``` for (int i = 1; i < ch.length; i++); ``` The problem is there, the semicolon. Remove it. This way, your for loop effectively looks like... ``` for (int i = 1; i < ch.length; i++) { // do nothing } ``` "`For`" executes the next block, but you ended that block with a semicolon.
31,779,480
Hi I am writing a method for a larger program but I keep getting the error that symbol cannot be found. please help! ``` public static int maxInc (char []ch) { int current = 1; int max = 1; if (ch.length == 0) { return 0; } else if (ch.length == 1) { return 1; } else { for (int i ...
2015/08/03
[ "https://Stackoverflow.com/questions/31779480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5184197/" ]
There is a semi colon in this line : ``` for (int i = 1; i < ch.length; i++); ``` Remove it and make the line as below: ``` for (int i = 1; i < ch.length; i++) ``` While there is a semicolon what is happening that the loop happen while nothing was done. It became just a statement. This below code was happening li...
I think that this line give error: ``` for (int i = 1; i < ch.length; i++); ``` Modify it as follow ``` for (int i = 1; i < ch.length; i++) ``` If not, tell me which line give you error.
25,917,261
I'm new to c++, and fairly sure the error is in the variables I'm passing into the function. Essentially, I have two functions defined in a double\_arrays.cpp file - first is to determine the Euclidian distance between two vectors (passed in as arrays with 10 values, this function works great). The other (closestPair) ...
2014/09/18
[ "https://Stackoverflow.com/questions/25917261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2673476/" ]
**Edit:** updated for Rust 1.x. You can't transmute arbitrary thing to arbitrary thing (like `Header` to `&[u8]`) because `transmute()` is akin to `reinterpret_cast` in C++: it literally reinterprets the bytes which its argument consists of, and in order for this to be successful the source and the target type should ...
You can make any object into a byte slice with a function like this: ``` /// Safe to use with any wholly initialized memory `ptr` unsafe fn raw_byte_repr<'a, T>(ptr: &'a T) -> &'a [u8] { std::mem::transmute(std::raw::Slice{ data: ptr as *const _ as *const u8, len: std::mem::size_of::<T>(), }) }...
60,319,702
I have a question about rendering components from object map. I have a structure like this: ``` const tabs = [ 'tab1': { name: 'Tab 1', renderComponent: () => <Tab1Component /> }, 'tab2': { name: 'Tab 2', renderComponent: () => <Tab2Component /> } ]; ``` I want to acce...
2020/02/20
[ "https://Stackoverflow.com/questions/60319702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6411644/" ]
Your array declaration is wrong. you should use object or array that includes objects. Try this block. ``` const tabs = { tab1: { name: "Tab 1", renderComponent: () => <Tab1Component /> }, tab2: { name: "Tab 2", renderComponent: () => <Tab2Component /> } }; ``` Also surround your js code with...
Here things i guess you did wrong is 1) adding the single quotes around the object-key 2) writing key-value pairs in array without enclosing it in {} I think you should do something like this ``` const tabs = [ { tab1: { name: 'Tab 1', renderComponent: () => ...
60,319,702
I have a question about rendering components from object map. I have a structure like this: ``` const tabs = [ 'tab1': { name: 'Tab 1', renderComponent: () => <Tab1Component /> }, 'tab2': { name: 'Tab 2', renderComponent: () => <Tab2Component /> } ]; ``` I want to acce...
2020/02/20
[ "https://Stackoverflow.com/questions/60319702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6411644/" ]
Your array declaration is wrong. you should use object or array that includes objects. Try this block. ``` const tabs = { tab1: { name: "Tab 1", renderComponent: () => <Tab1Component /> }, tab2: { name: "Tab 2", renderComponent: () => <Tab2Component /> } }; ``` Also surround your js code with...
``` const MyComponent = () => { const activeTab = 'tab2'; const tabs = [ {'tab1': { name: 'Tab 1', renderComponent: () => <Tab1Component /> }}, {'tab2':{ name: 'Tab 2', renderComponent: () => <Tab2Component /> }} ``` ]; ``` return ( <div> {tabs.map((el) => { if (el[activeTab]) { ...
844,384
I'm new to administering Windows Servers and have just been attempting to migrate AD, DHCP, DNS, roles from an old server to a new Windows Server 2016 box, and then retire the old server. All seems to have gone ok in the end, although I may have made some mistakes along the way including not transferring the FSMO role...
2017/04/13
[ "https://serverfault.com/questions/844384", "https://serverfault.com", "https://serverfault.com/users/327102/" ]
What did you do to "retire" the old server? Since you said you seized the roles, I'm assuming you didn't properly replicate then move the roles over and then eventually DCPROMO the old DC to remove it as a DC. In that situation, AD still thinks the old DC is "around". The good thing is that as of Windows Server 2008 ...
In your situation you can treat your old server as a primary DC that has failed. Luckily this wasn't your only DC as you had the new server as a backup DC! (Please keep it that way!) It is possible to transfer or seize FSMO roles to another domain controller with `ntdsutil.exe`. As you should be really careful when d...