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
24,296
I'm using the latest Truffle. Very nice, after having to roll my own dev environment in early 2016! But there is no obvious documentation as to what parts of the project need to be checked into Github. For example, I'm unsure if the `build` directory needs to be checked in. I think the answer is 'yes' because one woul...
2017/08/13
[ "https://ethereum.stackexchange.com/questions/24296", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/376/" ]
I have never used truffle, but my view (and the general rule as I understand) when it comes to source control is that you commit any files and folders that you want to track that can not be recreated. You should **not** commit the build directory because the built files can be.. rebuilt. Storing that data would be an ...
The answers here are good. Independent from wich project you are wokring on, I would add `.DS_Store` to any `.gitignore` file. It's a file used in MacOS for directory settings. So even if you are not using Mac, I would add it. You never know. Maybe you collaborate with a Mac user some day.
24,296
I'm using the latest Truffle. Very nice, after having to roll my own dev environment in early 2016! But there is no obvious documentation as to what parts of the project need to be checked into Github. For example, I'm unsure if the `build` directory needs to be checked in. I think the answer is 'yes' because one woul...
2017/08/13
[ "https://ethereum.stackexchange.com/questions/24296", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/376/" ]
This is the one I'm using rite now. I believe it may be helpful. ``` >$ cat .gitignore contracts/.placeholder test/.placeholder build node_modules ```
You could use one of the .gitignore on some well-known ethereum projects on GitHub. Try this: [OpenZeppelin's gitignore](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/.gitignore).
24,296
I'm using the latest Truffle. Very nice, after having to roll my own dev environment in early 2016! But there is no obvious documentation as to what parts of the project need to be checked into Github. For example, I'm unsure if the `build` directory needs to be checked in. I think the answer is 'yes' because one woul...
2017/08/13
[ "https://ethereum.stackexchange.com/questions/24296", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/376/" ]
This is the one I'm using rite now. I believe it may be helpful. ``` >$ cat .gitignore contracts/.placeholder test/.placeholder build node_modules ```
The answers here are good. Independent from wich project you are wokring on, I would add `.DS_Store` to any `.gitignore` file. It's a file used in MacOS for directory settings. So even if you are not using Mac, I would add it. You never know. Maybe you collaborate with a Mac user some day.
24,296
I'm using the latest Truffle. Very nice, after having to roll my own dev environment in early 2016! But there is no obvious documentation as to what parts of the project need to be checked into Github. For example, I'm unsure if the `build` directory needs to be checked in. I think the answer is 'yes' because one woul...
2017/08/13
[ "https://ethereum.stackexchange.com/questions/24296", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/376/" ]
The answer probably should be - you MUST check in your build directory once you've deployed, because it caches the addresses of your contracts, which is absolutely critical to the truffle deployment system! so: ``` >$ cat .gitignore contracts/.placeholder test/.placeholder node_modules ```
The answers here are good. Independent from wich project you are wokring on, I would add `.DS_Store` to any `.gitignore` file. It's a file used in MacOS for directory settings. So even if you are not using Mac, I would add it. You never know. Maybe you collaborate with a Mac user some day.
24,296
I'm using the latest Truffle. Very nice, after having to roll my own dev environment in early 2016! But there is no obvious documentation as to what parts of the project need to be checked into Github. For example, I'm unsure if the `build` directory needs to be checked in. I think the answer is 'yes' because one woul...
2017/08/13
[ "https://ethereum.stackexchange.com/questions/24296", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/376/" ]
This is the one I'm using rite now. I believe it may be helpful. ``` >$ cat .gitignore contracts/.placeholder test/.placeholder build node_modules ```
Consensys published an [example project](https://github.com/ConsenSys/example-truffle-library/blob/master/.gitignore) and it only has a key file which of course you shouldn't commit and `node_modules`. ``` deploy_mnemonic.key node_modules ```
24,296
I'm using the latest Truffle. Very nice, after having to roll my own dev environment in early 2016! But there is no obvious documentation as to what parts of the project need to be checked into Github. For example, I'm unsure if the `build` directory needs to be checked in. I think the answer is 'yes' because one woul...
2017/08/13
[ "https://ethereum.stackexchange.com/questions/24296", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/376/" ]
The answer probably should be - you MUST check in your build directory once you've deployed, because it caches the addresses of your contracts, which is absolutely critical to the truffle deployment system! so: ``` >$ cat .gitignore contracts/.placeholder test/.placeholder node_modules ```
I have never used truffle, but my view (and the general rule as I understand) when it comes to source control is that you commit any files and folders that you want to track that can not be recreated. You should **not** commit the build directory because the built files can be.. rebuilt. Storing that data would be an ...
24,296
I'm using the latest Truffle. Very nice, after having to roll my own dev environment in early 2016! But there is no obvious documentation as to what parts of the project need to be checked into Github. For example, I'm unsure if the `build` directory needs to be checked in. I think the answer is 'yes' because one woul...
2017/08/13
[ "https://ethereum.stackexchange.com/questions/24296", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/376/" ]
You could use one of the .gitignore on some well-known ethereum projects on GitHub. Try this: [OpenZeppelin's gitignore](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/.gitignore).
I have never used truffle, but my view (and the general rule as I understand) when it comes to source control is that you commit any files and folders that you want to track that can not be recreated. You should **not** commit the build directory because the built files can be.. rebuilt. Storing that data would be an ...
24,296
I'm using the latest Truffle. Very nice, after having to roll my own dev environment in early 2016! But there is no obvious documentation as to what parts of the project need to be checked into Github. For example, I'm unsure if the `build` directory needs to be checked in. I think the answer is 'yes' because one woul...
2017/08/13
[ "https://ethereum.stackexchange.com/questions/24296", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/376/" ]
Consensys published an [example project](https://github.com/ConsenSys/example-truffle-library/blob/master/.gitignore) and it only has a key file which of course you shouldn't commit and `node_modules`. ``` deploy_mnemonic.key node_modules ```
The answers here are good. Independent from wich project you are wokring on, I would add `.DS_Store` to any `.gitignore` file. It's a file used in MacOS for directory settings. So even if you are not using Mac, I would add it. You never know. Maybe you collaborate with a Mac user some day.
2,971,281
Wordpress presents some challenges since it tends to keep too much in the database, making it hard to move from server to server. What are some other issues to look out for? What was your workflow like?
2010/06/04
[ "https://Stackoverflow.com/questions/2971281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60223/" ]
I have a single WordPress install set up to power multiple domains on my development server. Plugin and theme files are also shared, so upgrading is a one-click process for *all* blogs. I use Apache VirtualHosts to map multiple domains to the same document root, and sprinkle a little magic in the main `wp-config.php` ...
If you have phpMyAdmin installed moving wordpress sites from server to server should not be a problem at all. Simply export the database to a tar.gz and copy your custom theme (if your using one) via FTP and then, after creating a new DB and fresh wordpress dump, re upload both of them to the new server. 2 changes in t...
2,971,281
Wordpress presents some challenges since it tends to keep too much in the database, making it hard to move from server to server. What are some other issues to look out for? What was your workflow like?
2010/06/04
[ "https://Stackoverflow.com/questions/2971281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60223/" ]
I have a single WordPress install set up to power multiple domains on my development server. Plugin and theme files are also shared, so upgrading is a one-click process for *all* blogs. I use Apache VirtualHosts to map multiple domains to the same document root, and sprinkle a little magic in the main `wp-config.php` ...
This Same Question was asked and answered on [WordPress.stackexchange](https://wordpress.stackexchange.com/q/119/251). It contains detailed information and best practices for rapid deployment from dev to production. --------------------------------------------------------------------------------------------------------...
2,971,281
Wordpress presents some challenges since it tends to keep too much in the database, making it hard to move from server to server. What are some other issues to look out for? What was your workflow like?
2010/06/04
[ "https://Stackoverflow.com/questions/2971281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60223/" ]
I have a single WordPress install set up to power multiple domains on my development server. Plugin and theme files are also shared, so upgrading is a one-click process for *all* blogs. I use Apache VirtualHosts to map multiple domains to the same document root, and sprinkle a little magic in the main `wp-config.php` ...
I have Development Site on my Local machine and change the local hosts file so, that calls to the live server (www.example.com) point to the localhost. That way all calls to external files (jquery, etc.) still work and I don't have to bother going through the db to change anything. Ex- and importing the content via th...
2,971,281
Wordpress presents some challenges since it tends to keep too much in the database, making it hard to move from server to server. What are some other issues to look out for? What was your workflow like?
2010/06/04
[ "https://Stackoverflow.com/questions/2971281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60223/" ]
This Same Question was asked and answered on [WordPress.stackexchange](https://wordpress.stackexchange.com/q/119/251). It contains detailed information and best practices for rapid deployment from dev to production. --------------------------------------------------------------------------------------------------------...
If you have phpMyAdmin installed moving wordpress sites from server to server should not be a problem at all. Simply export the database to a tar.gz and copy your custom theme (if your using one) via FTP and then, after creating a new DB and fresh wordpress dump, re upload both of them to the new server. 2 changes in t...
2,971,281
Wordpress presents some challenges since it tends to keep too much in the database, making it hard to move from server to server. What are some other issues to look out for? What was your workflow like?
2010/06/04
[ "https://Stackoverflow.com/questions/2971281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60223/" ]
I have Development Site on my Local machine and change the local hosts file so, that calls to the live server (www.example.com) point to the localhost. That way all calls to external files (jquery, etc.) still work and I don't have to bother going through the db to change anything. Ex- and importing the content via th...
If you have phpMyAdmin installed moving wordpress sites from server to server should not be a problem at all. Simply export the database to a tar.gz and copy your custom theme (if your using one) via FTP and then, after creating a new DB and fresh wordpress dump, re upload both of them to the new server. 2 changes in t...
2,971,281
Wordpress presents some challenges since it tends to keep too much in the database, making it hard to move from server to server. What are some other issues to look out for? What was your workflow like?
2010/06/04
[ "https://Stackoverflow.com/questions/2971281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60223/" ]
This Same Question was asked and answered on [WordPress.stackexchange](https://wordpress.stackexchange.com/q/119/251). It contains detailed information and best practices for rapid deployment from dev to production. --------------------------------------------------------------------------------------------------------...
I have Development Site on my Local machine and change the local hosts file so, that calls to the live server (www.example.com) point to the localhost. That way all calls to external files (jquery, etc.) still work and I don't have to bother going through the db to change anything. Ex- and importing the content via th...
4,297,581
I currently have a class containing the following properties ``` public class Chromosome { public int Length { get; set; } public int Number { get; set; } public Chromosome(int _length, int _number) { Length = _length; Number = _number; ...
2010/11/28
[ "https://Stackoverflow.com/questions/4297581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/504310/" ]
`Chromosome` is your Model. Your XAML code resides in your View. The hypothetical "modified-length" value should reside in your ViewModel. You are correct in saying that making a new property for the modified height is not MVVM (and is a very bad idea generally, of course). For a better approach, you would normally p...
You need to use a ValueConverter : <http://blogs.msdn.com/b/bencon/archive/2006/05/10/594886.aspx>
4,297,581
I currently have a class containing the following properties ``` public class Chromosome { public int Length { get; set; } public int Number { get; set; } public Chromosome(int _length, int _number) { Length = _length; Number = _number; ...
2010/11/28
[ "https://Stackoverflow.com/questions/4297581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/504310/" ]
`Chromosome` is your Model. Your XAML code resides in your View. The hypothetical "modified-length" value should reside in your ViewModel. You are correct in saying that making a new property for the modified height is not MVVM (and is a very bad idea generally, of course). For a better approach, you would normally p...
Why not use a converter here? See e.g. [MSDN](http://msdn.microsoft.com/en-us/library/ms752347.aspx#data_conversion)
35,314,080
I'm doing something like below but it's not working. Why is that? And how to do it? ``` public class A { private int a; private class BInner { a = 10; } } ```
2016/02/10
[ "https://Stackoverflow.com/questions/35314080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5663601/" ]
Usually the initialization stuff is done inside a constructor, so you can change or init the `outer class` variable `a` inside the constructor of `inner class`; like this: ``` public class A { private int a; private class BInner { public BInner(){ a = 10; } } } ```
You forgot to do the statement in a method: ``` public class A { private int a; private class BInner { void changeA(){ a = 10; } } } ```
50,825,557
Trying to write a program which will sum all odd elements of binary tree. But my code (function odd\_sum) returns only first odd element. Where is my mistake? ``` /*Creating abd printing tree*/ int odd_sum(node *root) { if (root == NULL) return 0; return root->info % 2 != 0 ? root->info:0 + odd_sum(root->left) +...
2018/06/12
[ "https://Stackoverflow.com/questions/50825557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9932405/" ]
If you meet an `odd` value in the tree you are just returning its value without branching down the tree, that's why you get only the first odd number. The corrected version of your code is on the line of: ``` int odd_sum(node *root){ if (root == NULL) { return 0; } else { int add = 0; ...
You need to traverse down the tree and whenever you find the node with odd value you can update your Sum variable. ``` void oddSum(node *root, int &Sum){ if(!root) return; if((root->val) & 1) Sum += root->val; oddSum(root->left, Sum); oddSum(root->right, Sum); } ``` ...
44,358,136
I have `remote_autostart` disabled and no cookie present: [![xdebug](https://i.stack.imgur.com/tSmdd.png)](https://i.stack.imgur.com/tSmdd.png) Still, Xdebug is connecting to my IDE (PhpStorm) at `192.168.22.101:9000` and zero-config debugging works. Why? How do I disable it? (It looks like autostart is somehow enabl...
2017/06/04
[ "https://Stackoverflow.com/questions/44358136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21728/" ]
My first bet would be that this is not the php.ini you're looking for. If you have CLI and normal php.ini, make sure you have this set up in both. Integrated PHP server counter-intuitively uses web php.ini instead of CLI one. Next step would be to check whether it's actually xdebug that's causing the issue. I'd do th...
I have been having exactly the same issue for a few days now. `remote_autostart` is set to off but it still triggers even on my own `<?php phpinfo();` script. The debugging session even starts when using an incognito browser session. Notice the odd IDE key btw, it is set automatically. [![phpinfo](https://i.stack.img...
26,905,868
I have a huge text file with sorted numbers in each line. I'd like to transform it into chunk of ranges using sed or awk. For instance: ``` 1 2 3 5 6 9 11 12 ``` Should be transformed into: ``` 1-3 5-6 9 11-12 ``` Is that reasonable to use sed for such transformation?
2014/11/13
[ "https://Stackoverflow.com/questions/26905868", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1327374/" ]
Here is one `awk` solution: ``` awk 'NR==1 {printf $0} p+1!=$0 {printf "-"p"\n"$0} {p=$0} END {print "-"$0}' file 1-3 5-6 9-9 11-12 ``` This assume that all lines does have numbers and they increases for every line. --- To be more portable/correct with `printf` ``` awk 'NR==1 {printf "%s",$0} p+1!=$0 {printf "-%s...
Perl solution: ``` perl -lne 'sub out { print $first == $prev ? $first : "$first-$prev" } # Produce the output. if ($_ != $prev+1 and defined $first) { # Current number not in seq. out(); # Output the previous seq. ...
26,905,868
I have a huge text file with sorted numbers in each line. I'd like to transform it into chunk of ranges using sed or awk. For instance: ``` 1 2 3 5 6 9 11 12 ``` Should be transformed into: ``` 1-3 5-6 9 11-12 ``` Is that reasonable to use sed for such transformation?
2014/11/13
[ "https://Stackoverflow.com/questions/26905868", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1327374/" ]
Here is one `awk` solution: ``` awk 'NR==1 {printf $0} p+1!=$0 {printf "-"p"\n"$0} {p=$0} END {print "-"$0}' file 1-3 5-6 9-9 11-12 ``` This assume that all lines does have numbers and they increases for every line. --- To be more portable/correct with `printf` ``` awk 'NR==1 {printf "%s",$0} p+1!=$0 {printf "-%s...
Ok guys, bash solution: ```bash A=`head -n1 data.txt` B=$A while read LINE do if [[ `expr $LINE - $B` != 1 ]] then if [[ "$A" != "$B" ]] then echo "-$B" else echo fi A=$LINE echo -n "$A" fi B=$LINE done < data.txt ```
41,619,316
Can you help me with the following issue? I have a large dataset of intraday financial data. More specifically, closing stock prices of each 15 minutes for multiple days. I face a problem in plotting the timeseries of the data. Here is an example of my series: ``` '29-Dec-2016 15:00:00' 62.8400000000000 '29-Dec-2016...
2017/01/12
[ "https://Stackoverflow.com/questions/41619316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6029488/" ]
That's because parentheses don't define lists. They sometimes define tuples `(a, b)`, which are similar to lists, but even in the code you provide, that is not a tuple. ``` ('string') ``` Is a parenthesized expression. It's value is `'string'`. ``` ('string',) ``` Is a 1-tuple that contains a single element, the ...
In the first case, the parenthesis are ambiguous. Do you mean a single element tuple or do you mean a parenthesized expression? The Python parser assumes parenthesized expression. You then are iterating over the string: ``` >>> li = ('string') >>> li 'string' ``` This is in contrast to creating a list literal or set...
52,783,704
hi guys i was trying to come up with the attached image, nested images using the grid in bootstrap. Image 3 should be over image 1 and 2[![enter image description here](https://i.stack.imgur.com/cHKhc.png)](https://i.stack.imgur.com/cHKhc.png) any help would be appreciated
2018/10/12
[ "https://Stackoverflow.com/questions/52783704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9045686/" ]
In the "Other location" text box you can enter the image name from DockerHub. For example, simply give "openjdk" or "openjdk:latest" to use <https://hub.docker.com/r/library/openjdk/> as the Docker image for your build. Don't put the "docker pull " prefix for your image name is all. Note that CodeBuild only supports p...
Lets say that you published your image in hub.docker.com, and your repo name is `gjackson/myrepo`, and you want to grab the image tagged `latest`, you should populate the other location field with `docker.io/gjackson/myrep:latest`.
37,312,405
I have 20 selects on a page and I need to detect when a user sets any one of them to a value > 0 (the default value for each one is 0). They are all of class "numSel" so I'm trying to make this code work: ``` if($('.numSel').val() > 0){ $("#submit").prop('disabled', false); } ``` But this only works ...
2016/05/19
[ "https://Stackoverflow.com/questions/37312405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936990/" ]
If the code is within a [`.change()`](https://api.jquery.com/change/) or [`.each()`](http://api.jquery.com/jquery.each/) block, you can use `this` to reference the `<select>` that changed. ``` $('.numSel').change(function() { if ($(this).val() > 0) $("#submit").prop('disabled', false); }).change(); // run ...
Assign your selects with `unique ids` and `same classes`. Let's say you assign their classes as `numSel`. And this is how you will detect all of them if they change. ``` function callbackFn() { var $sel = $(this); // $sel.attr('id'); var val = parseInt($sel.val()); if (val > 0) { $("#submit").prop('disab...
37,312,405
I have 20 selects on a page and I need to detect when a user sets any one of them to a value > 0 (the default value for each one is 0). They are all of class "numSel" so I'm trying to make this code work: ``` if($('.numSel').val() > 0){ $("#submit").prop('disabled', false); } ``` But this only works ...
2016/05/19
[ "https://Stackoverflow.com/questions/37312405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936990/" ]
If the code is within a [`.change()`](https://api.jquery.com/change/) or [`.each()`](http://api.jquery.com/jquery.each/) block, you can use `this` to reference the `<select>` that changed. ``` $('.numSel').change(function() { if ($(this).val() > 0) $("#submit").prop('disabled', false); }).change(); // run ...
This way, you are referring to the current select, and don't need to specify a specific selector: ``` $('.numSel').on('change', function() { if(parseInt($(this).val()) > 0) { $('#submit').prop('disabled', false); } }); ```
37,312,405
I have 20 selects on a page and I need to detect when a user sets any one of them to a value > 0 (the default value for each one is 0). They are all of class "numSel" so I'm trying to make this code work: ``` if($('.numSel').val() > 0){ $("#submit").prop('disabled', false); } ``` But this only works ...
2016/05/19
[ "https://Stackoverflow.com/questions/37312405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936990/" ]
If the code is within a [`.change()`](https://api.jquery.com/change/) or [`.each()`](http://api.jquery.com/jquery.each/) block, you can use `this` to reference the `<select>` that changed. ``` $('.numSel').change(function() { if ($(this).val() > 0) $("#submit").prop('disabled', false); }).change(); // run ...
How about this ? ``` $('.numSel').each(function(){ if(parseInt($(this).val())>0) //Your code }); ``` Explanation: For each of the class numSel, check through the value if it is more than 0.
37,312,405
I have 20 selects on a page and I need to detect when a user sets any one of them to a value > 0 (the default value for each one is 0). They are all of class "numSel" so I'm trying to make this code work: ``` if($('.numSel').val() > 0){ $("#submit").prop('disabled', false); } ``` But this only works ...
2016/05/19
[ "https://Stackoverflow.com/questions/37312405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936990/" ]
If the code is within a [`.change()`](https://api.jquery.com/change/) or [`.each()`](http://api.jquery.com/jquery.each/) block, you can use `this` to reference the `<select>` that changed. ``` $('.numSel').change(function() { if ($(this).val() > 0) $("#submit").prop('disabled', false); }).change(); // run ...
I might be misunderstanding the question, but I think what you are looking for is to allow submitting if any of the dropdowns is non-zero and always disable it if all of them are set to 0. If that's the case then this is what you need: ``` $('.numSel').on('change', function() { var isDisabled = true; $(this).e...
37,312,405
I have 20 selects on a page and I need to detect when a user sets any one of them to a value > 0 (the default value for each one is 0). They are all of class "numSel" so I'm trying to make this code work: ``` if($('.numSel').val() > 0){ $("#submit").prop('disabled', false); } ``` But this only works ...
2016/05/19
[ "https://Stackoverflow.com/questions/37312405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936990/" ]
If the code is within a [`.change()`](https://api.jquery.com/change/) or [`.each()`](http://api.jquery.com/jquery.each/) block, you can use `this` to reference the `<select>` that changed. ``` $('.numSel').change(function() { if ($(this).val() > 0) $("#submit").prop('disabled', false); }).change(); // run ...
You want to detect when the user sets any of the 20 t0 a value > 0 **but not when the user sets any to 0**. Right? You can use the `change` event and some logic or you can use the `change` event and a own `custom event`: ``` $('.numSel').on('change', function() { //if value > 0 trigger 'custom_event' !+this.va...
15,606
How do I learn to pronounce **Ä** (at least 2 different: "Ärzte" + slightly different "Ärmel", "ätzend") **Ö** (at least 2 different: "Öl", "Öffnung" + slightly different "Löffel") **Ü** (at least 2 different: "Übung", "üppig" + slightly different "Künstler") **Z** ("zwei") **CH** (2 very different: "Licht" + ver...
2014/09/10
[ "https://german.stackexchange.com/questions/15606", "https://german.stackexchange.com", "https://german.stackexchange.com/users/-1/" ]
**`Ä`** There's no obvious difference in pronouncing `Ärzte` or `Ärmel`. As for `ätzend`, the `ä` is slightly more "`e`-like" than the usual `ä`, as it is a short vowel. `Ä` is close in pronunciation to the `a` in `that` or `cap` - an `a` pronounced more "`e`-like". **`Ö`** Is pronounced like the `u` in `purse` ...
It is not easy to explain the special vowels of German, which traditionally are called Umlaute. But I remember having explained the articulation of ü to an American young man. My explanation was as follows: Say a long /i/ and keep your tongue in this i-position, i. e. the tongue is near the palate. Now round your lips ...
15,606
How do I learn to pronounce **Ä** (at least 2 different: "Ärzte" + slightly different "Ärmel", "ätzend") **Ö** (at least 2 different: "Öl", "Öffnung" + slightly different "Löffel") **Ü** (at least 2 different: "Übung", "üppig" + slightly different "Künstler") **Z** ("zwei") **CH** (2 very different: "Licht" + ver...
2014/09/10
[ "https://german.stackexchange.com/questions/15606", "https://german.stackexchange.com", "https://german.stackexchange.com/users/-1/" ]
**`Ä`** There's no obvious difference in pronouncing `Ärzte` or `Ärmel`. As for `ätzend`, the `ä` is slightly more "`e`-like" than the usual `ä`, as it is a short vowel. `Ä` is close in pronunciation to the `a` in `that` or `cap` - an `a` pronounced more "`e`-like". **`Ö`** Is pronounced like the `u` in `purse` ...
4 steps to a German [ch] as in "ich" 1. Pronounce an English [k] as in "cake" - with this your tongue is almost in right position, but a bit too far in the back 2. Now try to pronounce a 'long' [k] - you will hiss air instead of the short [k] 3. Now there are 2 things to do additionally at same time while still doing ...
15,606
How do I learn to pronounce **Ä** (at least 2 different: "Ärzte" + slightly different "Ärmel", "ätzend") **Ö** (at least 2 different: "Öl", "Öffnung" + slightly different "Löffel") **Ü** (at least 2 different: "Übung", "üppig" + slightly different "Künstler") **Z** ("zwei") **CH** (2 very different: "Licht" + ver...
2014/09/10
[ "https://german.stackexchange.com/questions/15606", "https://german.stackexchange.com", "https://german.stackexchange.com/users/-1/" ]
It is not easy to explain the special vowels of German, which traditionally are called Umlaute. But I remember having explained the articulation of ü to an American young man. My explanation was as follows: Say a long /i/ and keep your tongue in this i-position, i. e. the tongue is near the palate. Now round your lips ...
4 steps to a German [ch] as in "ich" 1. Pronounce an English [k] as in "cake" - with this your tongue is almost in right position, but a bit too far in the back 2. Now try to pronounce a 'long' [k] - you will hiss air instead of the short [k] 3. Now there are 2 things to do additionally at same time while still doing ...
245,826
I am working on a C# application and I want to support multiple themes, so I wrote a `ThemeManager` class that can check, load and apply a specific theme. A theme is considered valid, when all of it's member variables are set (not `null`). If a theme is invalid I want to throw an `IncompleteThemeException`. However the...
2020/07/21
[ "https://codereview.stackexchange.com/questions/245826", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/228002/" ]
It sure looks somehow clumsy like it is. You should place such stuff deep down the road, meaning you should have a method inside `Theme` e.g. `IsThemeValid()` where you can place all these `null` checks. Hence you would only have one method to maintain instead of each occurrence where you pass a `Theme`.
``` #nullable enable namespace Examples { using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; public class Program { public static void Main( String[] args ) { var theme = new Theme(); var vali...
245,826
I am working on a C# application and I want to support multiple themes, so I wrote a `ThemeManager` class that can check, load and apply a specific theme. A theme is considered valid, when all of it's member variables are set (not `null`). If a theme is invalid I want to throw an `IncompleteThemeException`. However the...
2020/07/21
[ "https://codereview.stackexchange.com/questions/245826", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/228002/" ]
Two things to think about: 1. Could you code this so it's impossible to create an invalid `Theme` instance thus not having to worry about it in this method? 2. How does a consumer know what is invalid about their instance? For 1, you could simply have a constructor that takes all of the arguments and throws if any ar...
It sure looks somehow clumsy like it is. You should place such stuff deep down the road, meaning you should have a method inside `Theme` e.g. `IsThemeValid()` where you can place all these `null` checks. Hence you would only have one method to maintain instead of each occurrence where you pass a `Theme`.
245,826
I am working on a C# application and I want to support multiple themes, so I wrote a `ThemeManager` class that can check, load and apply a specific theme. A theme is considered valid, when all of it's member variables are set (not `null`). If a theme is invalid I want to throw an `IncompleteThemeException`. However the...
2020/07/21
[ "https://codereview.stackexchange.com/questions/245826", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/228002/" ]
If you want your `Theme` to be unaware of what is valid or invalid which makes sense as `ThemeLoader` may be responsible for defining it, you may try writing something like ef core's fluent api. Something like following; ``` var validator = new ThemeValidator<Theme>(); validator.Property(theme => theme.Accent...
``` #nullable enable namespace Examples { using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; public class Program { public static void Main( String[] args ) { var theme = new Theme(); var vali...
245,826
I am working on a C# application and I want to support multiple themes, so I wrote a `ThemeManager` class that can check, load and apply a specific theme. A theme is considered valid, when all of it's member variables are set (not `null`). If a theme is invalid I want to throw an `IncompleteThemeException`. However the...
2020/07/21
[ "https://codereview.stackexchange.com/questions/245826", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/228002/" ]
It sure looks somehow clumsy like it is. You should place such stuff deep down the road, meaning you should have a method inside `Theme` e.g. `IsThemeValid()` where you can place all these `null` checks. Hence you would only have one method to maintain instead of each occurrence where you pass a `Theme`.
The code is not too far off of the of execution and I take your reflection proposal as a means to work around limitations in the language. This is a fairly straightforward use case for code generation. Something [like T4](https://blogs.u2u.be/peter/post/Using-T4-to-automatically-generate-your-entities) or [AOP via Pos...
245,826
I am working on a C# application and I want to support multiple themes, so I wrote a `ThemeManager` class that can check, load and apply a specific theme. A theme is considered valid, when all of it's member variables are set (not `null`). If a theme is invalid I want to throw an `IncompleteThemeException`. However the...
2020/07/21
[ "https://codereview.stackexchange.com/questions/245826", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/228002/" ]
Two things to think about: 1. Could you code this so it's impossible to create an invalid `Theme` instance thus not having to worry about it in this method? 2. How does a consumer know what is invalid about their instance? For 1, you could simply have a constructor that takes all of the arguments and throws if any ar...
If you want your `Theme` to be unaware of what is valid or invalid which makes sense as `ThemeLoader` may be responsible for defining it, you may try writing something like ef core's fluent api. Something like following; ``` var validator = new ThemeValidator<Theme>(); validator.Property(theme => theme.Accent...
245,826
I am working on a C# application and I want to support multiple themes, so I wrote a `ThemeManager` class that can check, load and apply a specific theme. A theme is considered valid, when all of it's member variables are set (not `null`). If a theme is invalid I want to throw an `IncompleteThemeException`. However the...
2020/07/21
[ "https://codereview.stackexchange.com/questions/245826", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/228002/" ]
Since your `Theme` class is a user defined class, you could do something like : ``` public class Theme { // Cache the reflection once, then reuse it private static readonly PropertyInfo[] _properties = typeof(Theme).GetProperties(); // properties public Theme() { } public bool IsValid() { ...
Two things to think about: 1. Could you code this so it's impossible to create an invalid `Theme` instance thus not having to worry about it in this method? 2. How does a consumer know what is invalid about their instance? For 1, you could simply have a constructor that takes all of the arguments and throws if any ar...
245,826
I am working on a C# application and I want to support multiple themes, so I wrote a `ThemeManager` class that can check, load and apply a specific theme. A theme is considered valid, when all of it's member variables are set (not `null`). If a theme is invalid I want to throw an `IncompleteThemeException`. However the...
2020/07/21
[ "https://codereview.stackexchange.com/questions/245826", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/228002/" ]
Two things to think about: 1. Could you code this so it's impossible to create an invalid `Theme` instance thus not having to worry about it in this method? 2. How does a consumer know what is invalid about their instance? For 1, you could simply have a constructor that takes all of the arguments and throws if any ar...
The code is not too far off of the of execution and I take your reflection proposal as a means to work around limitations in the language. This is a fairly straightforward use case for code generation. Something [like T4](https://blogs.u2u.be/peter/post/Using-T4-to-automatically-generate-your-entities) or [AOP via Pos...
245,826
I am working on a C# application and I want to support multiple themes, so I wrote a `ThemeManager` class that can check, load and apply a specific theme. A theme is considered valid, when all of it's member variables are set (not `null`). If a theme is invalid I want to throw an `IncompleteThemeException`. However the...
2020/07/21
[ "https://codereview.stackexchange.com/questions/245826", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/228002/" ]
It sure looks somehow clumsy like it is. You should place such stuff deep down the road, meaning you should have a method inside `Theme` e.g. `IsThemeValid()` where you can place all these `null` checks. Hence you would only have one method to maintain instead of each occurrence where you pass a `Theme`.
If you want your `Theme` to be unaware of what is valid or invalid which makes sense as `ThemeLoader` may be responsible for defining it, you may try writing something like ef core's fluent api. Something like following; ``` var validator = new ThemeValidator<Theme>(); validator.Property(theme => theme.Accent...
245,826
I am working on a C# application and I want to support multiple themes, so I wrote a `ThemeManager` class that can check, load and apply a specific theme. A theme is considered valid, when all of it's member variables are set (not `null`). If a theme is invalid I want to throw an `IncompleteThemeException`. However the...
2020/07/21
[ "https://codereview.stackexchange.com/questions/245826", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/228002/" ]
Since your `Theme` class is a user defined class, you could do something like : ``` public class Theme { // Cache the reflection once, then reuse it private static readonly PropertyInfo[] _properties = typeof(Theme).GetProperties(); // properties public Theme() { } public bool IsValid() { ...
``` #nullable enable namespace Examples { using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; public class Program { public static void Main( String[] args ) { var theme = new Theme(); var vali...
245,826
I am working on a C# application and I want to support multiple themes, so I wrote a `ThemeManager` class that can check, load and apply a specific theme. A theme is considered valid, when all of it's member variables are set (not `null`). If a theme is invalid I want to throw an `IncompleteThemeException`. However the...
2020/07/21
[ "https://codereview.stackexchange.com/questions/245826", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/228002/" ]
Since your `Theme` class is a user defined class, you could do something like : ``` public class Theme { // Cache the reflection once, then reuse it private static readonly PropertyInfo[] _properties = typeof(Theme).GetProperties(); // properties public Theme() { } public bool IsValid() { ...
It sure looks somehow clumsy like it is. You should place such stuff deep down the road, meaning you should have a method inside `Theme` e.g. `IsThemeValid()` where you can place all these `null` checks. Hence you would only have one method to maintain instead of each occurrence where you pass a `Theme`.
23,740,715
I have an angularjs service which calculates a products price based on discounts, quantity, etc. I'm trying to write a jasmine test to call this service, passing in test data. I get an error that the app is missing it's dependencies. I don't want to have to load Ui router, shouldn't mocks take care of that? ``` Error...
2014/05/19
[ "https://Stackoverflow.com/questions/23740715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2005616/" ]
As already mentioned there is `- (void)applicationDidBecomeActive:(UIApplication *)application;`in App Delegate, but most of the time you need the information not in your app delegate but your view Controller. Therefore you can use `NSNotificationCenter`. In your app delegate you *could* do the following: ``` NSNotifi...
In the appDelegate there is method called `applicationDidBecomeActive:(UIApplication *)application` it is triggered when your app became active.
23,740,715
I have an angularjs service which calculates a products price based on discounts, quantity, etc. I'm trying to write a jasmine test to call this service, passing in test data. I get an error that the app is missing it's dependencies. I don't want to have to load Ui router, shouldn't mocks take care of that? ``` Error...
2014/05/19
[ "https://Stackoverflow.com/questions/23740715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2005616/" ]
As already mentioned there is `- (void)applicationDidBecomeActive:(UIApplication *)application;`in App Delegate, but most of the time you need the information not in your app delegate but your view Controller. Therefore you can use `NSNotificationCenter`. In your app delegate you *could* do the following: ``` NSNotifi...
Try calling the method via the below app delegate method : ``` - (void)applicationDidBecomeActive:(UIApplication *)application; ```
23,740,715
I have an angularjs service which calculates a products price based on discounts, quantity, etc. I'm trying to write a jasmine test to call this service, passing in test data. I get an error that the app is missing it's dependencies. I don't want to have to load Ui router, shouldn't mocks take care of that? ``` Error...
2014/05/19
[ "https://Stackoverflow.com/questions/23740715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2005616/" ]
As already mentioned there is `- (void)applicationDidBecomeActive:(UIApplication *)application;`in App Delegate, but most of the time you need the information not in your app delegate but your view Controller. Therefore you can use `NSNotificationCenter`. In your app delegate you *could* do the following: ``` NSNotifi...
You should implement the `applicationWillEnterForeground:` method in your AppDelegate, like this: ``` - (void)applicationWillEnterForeground:(UIApplication *)application { [self.controller nowYouSeeMe]; } ``` provided that you have a reference to that controller as a property in your AppDelegate.
23,740,715
I have an angularjs service which calculates a products price based on discounts, quantity, etc. I'm trying to write a jasmine test to call this service, passing in test data. I get an error that the app is missing it's dependencies. I don't want to have to load Ui router, shouldn't mocks take care of that? ``` Error...
2014/05/19
[ "https://Stackoverflow.com/questions/23740715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2005616/" ]
As already mentioned there is `- (void)applicationDidBecomeActive:(UIApplication *)application;`in App Delegate, but most of the time you need the information not in your app delegate but your view Controller. Therefore you can use `NSNotificationCenter`. In your app delegate you *could* do the following: ``` NSNotifi...
As per everybody else's answer, the application delegate will get a call-out via `applicationDidBecomeActive:`. The application will also post the `UIApplicationDidBecomeActiveNotification` notification. So anyone that isn't the app delegate can just observe that. You shouldn't use the application delegate as a lazy ...
53,989,113
I'm trying to upload a file using the Google Drive api on Android <https://github.com/googlesamples/google-services/tree/master/android/signin/app/src/main/java/com/google/samples/quickstart/signin> I signed up to SignInActivityWithDrive.java in the link above. But there is no example of uploading a file, downloadin...
2018/12/31
[ "https://Stackoverflow.com/questions/53989113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10852372/" ]
You can find basic examples of [uploading](https://developers.google.com/drive/api/v3/manage-uploads) and [downloading](https://developers.google.com/drive/api/v3/manage-downloads) in the docs. **Uploading** > > You can send upload requests in any of the following ways: > > > * Simple upload: `uploadType=media`. F...
It is 2022 now, and how the Google Drive API works might have changed significantly. I needed to upload a number of large files from a remote server where I have terminal access. This is how I got it working for me: 1. Use the steps detailed in [this link](https://d35mpxyw7m7k7g.cloudfront.net/bigdata_1/Get+Authentica...
28,601,174
It looks like a simple task, but how would you solve it? I don't get any solution right now. ``` ls_message-text = 'Pernr. 12345678 (Pete Peterson) is valid (06/2015). append ls_message to lt_message. ls_message-text = 'Pernr. 12345678 (Pete Peterson) is valid (07/2015). append ls_message to lt_message. ``` This is...
2015/02/19
[ "https://Stackoverflow.com/questions/28601174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/909388/" ]
Assuming you want to retain only one message for each unique Pernr. in `lt_message`, you can use regex to filter for the Pernr. and use that as "key". Now you can delete all but the first message of `lt_message` that matches this key. Expand your regex if you want to keep only certain messages, e.g. only the "is vali...
have you tried looking to program DEMO\_REGEX\_TOY. Gives an idea on how to work with Regular expresion, that probably will save the problem
28,601,174
It looks like a simple task, but how would you solve it? I don't get any solution right now. ``` ls_message-text = 'Pernr. 12345678 (Pete Peterson) is valid (06/2015). append ls_message to lt_message. ls_message-text = 'Pernr. 12345678 (Pete Peterson) is valid (07/2015). append ls_message to lt_message. ``` This is...
2015/02/19
[ "https://Stackoverflow.com/questions/28601174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/909388/" ]
Maybe you could solve your requirement using the Levenshtein distance . ABAP has a built-in function "distance" that gives you the number of operations to convert one string into another. Ex: ``` DATA msg1 type string. DATA msg2 type string. msg1 = 'Levehnstein Distance 7/2015'. msg2 = 'Levehnstein Dista...
have you tried looking to program DEMO\_REGEX\_TOY. Gives an idea on how to work with Regular expresion, that probably will save the problem
28,601,174
It looks like a simple task, but how would you solve it? I don't get any solution right now. ``` ls_message-text = 'Pernr. 12345678 (Pete Peterson) is valid (06/2015). append ls_message to lt_message. ls_message-text = 'Pernr. 12345678 (Pete Peterson) is valid (07/2015). append ls_message to lt_message. ``` This is...
2015/02/19
[ "https://Stackoverflow.com/questions/28601174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/909388/" ]
Maybe you could solve your requirement using the Levenshtein distance . ABAP has a built-in function "distance" that gives you the number of operations to convert one string into another. Ex: ``` DATA msg1 type string. DATA msg2 type string. msg1 = 'Levehnstein Distance 7/2015'. msg2 = 'Levehnstein Dista...
Assuming you want to retain only one message for each unique Pernr. in `lt_message`, you can use regex to filter for the Pernr. and use that as "key". Now you can delete all but the first message of `lt_message` that matches this key. Expand your regex if you want to keep only certain messages, e.g. only the "is vali...
23,171,031
I have a class called `cNormType`. I want to create another instance of this class with the name contained in the string `sNT`. The namespace is `QM`. I want to pass five parameters to the constructor for this class (`sNN,sTN,sDN,sHI,sLO`). I tried: ``` Type t1 = Type.GetType("QM.cNormType", sNT); Activator.CreateIn...
2014/04/19
[ "https://Stackoverflow.com/questions/23171031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3550110/" ]
What exactly are those brackets in the second statement supposed to be doing? Is that an attempt to create an array? That's not how you create an array and you don't need to create one anyway. That second parameter is declared `params`, which means that you can just pass discrete arguments and the system will package t...
I can't test the whole thing since I don't have all your code, but remove the square brackets: ``` Type t1 = Type.GetType("QM.cNormType"); cNormType newNorm = (cNormType)Activator.CreateInstance(t1, sNT, sTN, sDN, sHI, sLO); ``` I'm not sure what you mean by creating an instance of the class using the name in `...
23,171,031
I have a class called `cNormType`. I want to create another instance of this class with the name contained in the string `sNT`. The namespace is `QM`. I want to pass five parameters to the constructor for this class (`sNN,sTN,sDN,sHI,sLO`). I tried: ``` Type t1 = Type.GetType("QM.cNormType", sNT); Activator.CreateIn...
2014/04/19
[ "https://Stackoverflow.com/questions/23171031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3550110/" ]
What exactly are those brackets in the second statement supposed to be doing? Is that an attempt to create an array? That's not how you create an array and you don't need to create one anyway. That second parameter is declared `params`, which means that you can just pass discrete arguments and the system will package t...
I'm making some really wild assumptions here about what you're trying to do, but does this achieve what you actually wanted? ``` Dictionary<string, cNormType> norms = new Dictionary<string, cNormType>(); ... norms[sNT] = new cNormType(t1, sNN, sTN, sDN, sHI, sLO); ``` `norms[sNT]` is then how you would refer to e...
66,290,018
i have in app component array hook that i need to update, but i have one variable that i cannot update , dont understand why ***app component code*** ``` function App() { const [coins, setCoins] = useState([{name:'Shekel',price:2}, {name:'Dollar',price:3}, {name:'Rubal',price:20}]) const [changeHistory, setChange...
2021/02/20
[ "https://Stackoverflow.com/questions/66290018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15043283/" ]
I believe a good way would be to first get your key, value pairs in a dictionary (with `dict` and `zip`, and then just filter on index position using `loc`. This way you ensure you can always get back your required `dataframe` by explicitly stating the index position. ``` k = dict(zip(df.index,df['user'].apply(lambda ...
Using python basic functionality **List Comprehension** we can list out our desired data. ``` list_john = [i for i in df1.user if i[0:5] == f'John ']; list_johnny = [i for i in df1.user if i[0:5] == f'Johnny']; ``` then make two df object using above list: ``` pd.DataFrame(list_john) pd.DataFrame(list_johnny) ```
66,290,018
i have in app component array hook that i need to update, but i have one variable that i cannot update , dont understand why ***app component code*** ``` function App() { const [coins, setCoins] = useState([{name:'Shekel',price:2}, {name:'Dollar',price:3}, {name:'Rubal',price:20}]) const [changeHistory, setChange...
2021/02/20
[ "https://Stackoverflow.com/questions/66290018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15043283/" ]
After sorting the dataframe you can use [`str.split`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.split.html) to split the strings in the `user` column to create a grouping `key`, then `group` the dataframe on this grouping key and for each subgroup per `user` create a mapping of `user`...
Using python basic functionality **List Comprehension** we can list out our desired data. ``` list_john = [i for i in df1.user if i[0:5] == f'John ']; list_johnny = [i for i in df1.user if i[0:5] == f'Johnny']; ``` then make two df object using above list: ``` pd.DataFrame(list_john) pd.DataFrame(list_johnny) ```
66,290,018
i have in app component array hook that i need to update, but i have one variable that i cannot update , dont understand why ***app component code*** ``` function App() { const [coins, setCoins] = useState([{name:'Shekel',price:2}, {name:'Dollar',price:3}, {name:'Rubal',price:20}]) const [changeHistory, setChange...
2021/02/20
[ "https://Stackoverflow.com/questions/66290018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15043283/" ]
You can get the first index value and split it and exclude last item(assuming that user name may have parenthesis), and then search for the value in the entire dataframe for that particular column. For example: ``` firstIndexUser = df1['user'].str.split('(').str[:-1].str.join('(').iloc[0] ``` This **firstIndexUser**...
After sorting the dataframe you can use [`str.split`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.split.html) to split the strings in the `user` column to create a grouping `key`, then `group` the dataframe on this grouping key and for each subgroup per `user` create a mapping of `user`...
66,290,018
i have in app component array hook that i need to update, but i have one variable that i cannot update , dont understand why ***app component code*** ``` function App() { const [coins, setCoins] = useState([{name:'Shekel',price:2}, {name:'Dollar',price:3}, {name:'Rubal',price:20}]) const [changeHistory, setChange...
2021/02/20
[ "https://Stackoverflow.com/questions/66290018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15043283/" ]
First line adds a column for name Create a dictionary with each entry as a dataframe with key as unique name ``` df1['name']=[x.split(' ')[0] for x in df1['user']] for nam in list(df1.name.value_counts().index): dct[nam] = df1[df1['name']==nam][['user','value']].reset_index(drop=True) ```
Using python basic functionality **List Comprehension** we can list out our desired data. ``` list_john = [i for i in df1.user if i[0:5] == f'John ']; list_johnny = [i for i in df1.user if i[0:5] == f'Johnny']; ``` then make two df object using above list: ``` pd.DataFrame(list_john) pd.DataFrame(list_johnny) ```
66,290,018
i have in app component array hook that i need to update, but i have one variable that i cannot update , dont understand why ***app component code*** ``` function App() { const [coins, setCoins] = useState([{name:'Shekel',price:2}, {name:'Dollar',price:3}, {name:'Rubal',price:20}]) const [changeHistory, setChange...
2021/02/20
[ "https://Stackoverflow.com/questions/66290018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15043283/" ]
You can get the first index value and split it and exclude last item(assuming that user name may have parenthesis), and then search for the value in the entire dataframe for that particular column. For example: ``` firstIndexUser = df1['user'].str.split('(').str[:-1].str.join('(').iloc[0] ``` This **firstIndexUser**...
Using python basic functionality **List Comprehension** we can list out our desired data. ``` list_john = [i for i in df1.user if i[0:5] == f'John ']; list_johnny = [i for i in df1.user if i[0:5] == f'Johnny']; ``` then make two df object using above list: ``` pd.DataFrame(list_john) pd.DataFrame(list_johnny) ```
66,290,018
i have in app component array hook that i need to update, but i have one variable that i cannot update , dont understand why ***app component code*** ``` function App() { const [coins, setCoins] = useState([{name:'Shekel',price:2}, {name:'Dollar',price:3}, {name:'Rubal',price:20}]) const [changeHistory, setChange...
2021/02/20
[ "https://Stackoverflow.com/questions/66290018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15043283/" ]
After sorting the dataframe you can use [`str.split`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.split.html) to split the strings in the `user` column to create a grouping `key`, then `group` the dataframe on this grouping key and for each subgroup per `user` create a mapping of `user`...
I believe a good way would be to first get your key, value pairs in a dictionary (with `dict` and `zip`, and then just filter on index position using `loc`. This way you ensure you can always get back your required `dataframe` by explicitly stating the index position. ``` k = dict(zip(df.index,df['user'].apply(lambda ...
66,290,018
i have in app component array hook that i need to update, but i have one variable that i cannot update , dont understand why ***app component code*** ``` function App() { const [coins, setCoins] = useState([{name:'Shekel',price:2}, {name:'Dollar',price:3}, {name:'Rubal',price:20}]) const [changeHistory, setChange...
2021/02/20
[ "https://Stackoverflow.com/questions/66290018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15043283/" ]
You can get the first index value and split it and exclude last item(assuming that user name may have parenthesis), and then search for the value in the entire dataframe for that particular column. For example: ``` firstIndexUser = df1['user'].str.split('(').str[:-1].str.join('(').iloc[0] ``` This **firstIndexUser**...
``` df1 = pd.DataFrame({"user": ["Peter (1)", "Peter (2)", "Peter (3)","John (1)","John (2)","John (3)","Johnny (1)","Johnny (2)"], "value": [1, 3, 3, 1, 6, 3, 4, 1]}, ) df1=df1.sort_values(by='value', ascending=False) cols = df1.columns.tolist() df1['name'] = df1['user'].replace(r'\s\(\d\)','',regex=True) grp = df1....
66,290,018
i have in app component array hook that i need to update, but i have one variable that i cannot update , dont understand why ***app component code*** ``` function App() { const [coins, setCoins] = useState([{name:'Shekel',price:2}, {name:'Dollar',price:3}, {name:'Rubal',price:20}]) const [changeHistory, setChange...
2021/02/20
[ "https://Stackoverflow.com/questions/66290018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15043283/" ]
You can get the first index value and split it and exclude last item(assuming that user name may have parenthesis), and then search for the value in the entire dataframe for that particular column. For example: ``` firstIndexUser = df1['user'].str.split('(').str[:-1].str.join('(').iloc[0] ``` This **firstIndexUser**...
I believe a good way would be to first get your key, value pairs in a dictionary (with `dict` and `zip`, and then just filter on index position using `loc`. This way you ensure you can always get back your required `dataframe` by explicitly stating the index position. ``` k = dict(zip(df.index,df['user'].apply(lambda ...
66,290,018
i have in app component array hook that i need to update, but i have one variable that i cannot update , dont understand why ***app component code*** ``` function App() { const [coins, setCoins] = useState([{name:'Shekel',price:2}, {name:'Dollar',price:3}, {name:'Rubal',price:20}]) const [changeHistory, setChange...
2021/02/20
[ "https://Stackoverflow.com/questions/66290018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15043283/" ]
``` df1 = pd.DataFrame({"user": ["Peter (1)", "Peter (2)", "Peter (3)","John (1)","John (2)","John (3)","Johnny (1)","Johnny (2)"], "value": [1, 3, 3, 1, 6, 3, 4, 1]}, ) df1=df1.sort_values(by='value', ascending=False) cols = df1.columns.tolist() df1['name'] = df1['user'].replace(r'\s\(\d\)','',regex=True) grp = df1....
Using python basic functionality **List Comprehension** we can list out our desired data. ``` list_john = [i for i in df1.user if i[0:5] == f'John ']; list_johnny = [i for i in df1.user if i[0:5] == f'Johnny']; ``` then make two df object using above list: ``` pd.DataFrame(list_john) pd.DataFrame(list_johnny) ```
66,290,018
i have in app component array hook that i need to update, but i have one variable that i cannot update , dont understand why ***app component code*** ``` function App() { const [coins, setCoins] = useState([{name:'Shekel',price:2}, {name:'Dollar',price:3}, {name:'Rubal',price:20}]) const [changeHistory, setChange...
2021/02/20
[ "https://Stackoverflow.com/questions/66290018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15043283/" ]
``` df1 = pd.DataFrame({"user": ["Peter (1)", "Peter (2)", "Peter (3)","John (1)","John (2)","John (3)","Johnny (1)","Johnny (2)"], "value": [1, 3, 3, 1, 6, 3, 4, 1]}, ) df1=df1.sort_values(by='value', ascending=False) cols = df1.columns.tolist() df1['name'] = df1['user'].replace(r'\s\(\d\)','',regex=True) grp = df1....
I believe a good way would be to first get your key, value pairs in a dictionary (with `dict` and `zip`, and then just filter on index position using `loc`. This way you ensure you can always get back your required `dataframe` by explicitly stating the index position. ``` k = dict(zip(df.index,df['user'].apply(lambda ...
29,756,833
I'm trying to implement a roullete wheel in java. I create two methods. One is to create the roullete wheel and another to rotate the roullete wheel. How I should do to implement the probalibities. My methods are not doing that. My method to create the roullete wheel is totally wrong. For example if I get: 50% for ...
2015/04/20
[ "https://Stackoverflow.com/questions/29756833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4798093/" ]
The code you have to scramble the word is indeed correct. To do what you're asking, you really only have to make one change to the above code. Just place a function declaration in a `.m` file and call it something like `scramble.m`. Then do: ``` function word = scramble word = input('type a word to be scrambled: '...
The general format of a matlab function is ``` function output = MyFunctionName(input) ... code using 'input' goes here end % ``` If you have multiple outputs, you place them inside an array, preferably separated by commas. If you have multiple inputs, you list them separated by commas: ``` fun...
26,686,716
Hello: I am trying to do something relatively simple I think, but I am fumbling around trying to figure this out and have gotten nowhere. Essentially all I want is this: 1. have a drop down on a page with a few options with a submit button below the drop down; 2. if you select different items in the drop down it will ...
2014/11/01
[ "https://Stackoverflow.com/questions/26686716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3897402/" ]
There are two problems with ``` (preg_replace('/(>\s+<)|(>\n+<)/', ' ', $str) ``` * `\s` already includes `\n` hence there is no need to provide another alternation. * `(>\s+<)`here the regex consumes both the angulars `<` and `>` hence replacing with space would remove everything including the angulars The output...
You can try with this: ``` echo preg_replace("/(?=\>\s+\n|\n)+(\s+)/", "", $str); ```
26,686,716
Hello: I am trying to do something relatively simple I think, but I am fumbling around trying to figure this out and have gotten nowhere. Essentially all I want is this: 1. have a drop down on a page with a few options with a submit button below the drop down; 2. if you select different items in the drop down it will ...
2014/11/01
[ "https://Stackoverflow.com/questions/26686716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3897402/" ]
There are two problems with ``` (preg_replace('/(>\s+<)|(>\n+<)/', ' ', $str) ``` * `\s` already includes `\n` hence there is no need to provide another alternation. * `(>\s+<)`here the regex consumes both the angulars `<` and `>` hence replacing with space would remove everything including the angulars The output...
``` (?<=<\/h>)\s+ ``` Try this.See demo.Replace by `empty string` <http://regex101.com/r/jI8lV7/1>
14,443,202
The C# 4.0 specs read: > > When a virtual method is invoked, the runtime type of the instance for > which that invocation takes place determines the actual method > implementation to invoke. In a nonvirtual method invocation, the > compile-time type of the instance is the determining factor. > > > At first, I ...
2013/01/21
[ "https://Stackoverflow.com/questions/14443202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87796/" ]
This is more a matter of virtual vs. non-virtual methods, and how the invocation occurs. The portion of the spec you are quoting deals with method calls on a variable - calling `bcDerived.SomeMethod()`, not calling `foo.SomeMethod(bcDerived)`. The specification you are quoting refers to the case where you have non-vir...
In this instance the compile time type of the argument will always be used to determine which overload to call. Virtual dispatch depends upon the runtime type of the object that the method is being called on. The compile time type is the type of the object as determined by the compiler and the runtime type is the actu...
14,443,202
The C# 4.0 specs read: > > When a virtual method is invoked, the runtime type of the instance for > which that invocation takes place determines the actual method > implementation to invoke. In a nonvirtual method invocation, the > compile-time type of the instance is the determining factor. > > > At first, I ...
2013/01/21
[ "https://Stackoverflow.com/questions/14443202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87796/" ]
This is more a matter of virtual vs. non-virtual methods, and how the invocation occurs. The portion of the spec you are quoting deals with method calls on a variable - calling `bcDerived.SomeMethod()`, not calling `foo.SomeMethod(bcDerived)`. The specification you are quoting refers to the case where you have non-vir...
``` Using these two classes as examples: public class Parent { public void NonVirtual() { Console.WriteLine("Nonvirtual - Parent"); } public virtual void Virtual() { Console.WriteLine("Virtual - Parent"); } } public class Child : Parent { public override void Virtual() ...
57,610,143
I’m trying to create a Tizen wearable web application using Angular 7. The idea is to realize a simple angular app and then put the build files (obtained with ng build --prod command) inside a Tizen Studio base project. This way I can build to a wearable device. Everything seems to work properly but now I’m facing a ...
2019/08/22
[ "https://Stackoverflow.com/questions/57610143", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6583593/" ]
1. You can use `(<any>window).tizen.application...` or even better, extend `Window` interface with `tizen` object. 2. TAU library is based on jQuery mobile - it is not designed to work with Angular. These frameworks are completely different.
The comment above, worked for me. I implemented on the first page of my app an event to listen the return button of the remote (keyCode = 10009) and to close the application, i implemented the code above. ``` import {Component, HostListener, OnInit} from '@angular/core'; @Component({ selector: 'app-mycomponent', ...
15,930,495
I am developing a web application using Hibernate framework. I got this error when trying to run webapp. Error Console: ```java Exception caught in Create Account Dataorg.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer] java.lang.NullPointerException...
2013/04/10
[ "https://Stackoverflow.com/questions/15930495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2068790/" ]
You should explicitly define no-arg constructor. This is a requirement from Hibernate to all POJOs. Detailed explanation could be found here: <https://stackoverflow.com/a/2971717/283426>
that is right you need to have a constructor with no argument so it enables to initiate an object with the controller and as well as service class or anyway you are using that object.
3,376,450
We are given a red box, a blue box and a green box, and also given 10 red balls, 10 blue balls, and 10 green balls. Balls of the same color are indistinguishable. Consider the following constraints: 1: No box contains a ball that has the same colour as the box. 2: No box is empty. Find the number of ways to put 3...
2019/10/01
[ "https://math.stackexchange.com/questions/3376450", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
(I will assume that when you said constraints A and B, you meant 1 and 2 respectively.) a) We first ignore the given constraint and count the number of ways to distribute the 30 balls among the three boxes. Using "Stars and Bars" we can distribute the red balls in $$\binom{10+3-1}{3-1} = \binom{12}{2}$$ ways. The bl...
I preassume that all balls must be placed in a box and that every box can contain any number of balls that does not exceed $30$. --- * Concerning the constraint that no box contains a ball that has the same colour as the box. The $10$ red balls must be split up in balls that are placed in the blue box an balls that ...
3,376,450
We are given a red box, a blue box and a green box, and also given 10 red balls, 10 blue balls, and 10 green balls. Balls of the same color are indistinguishable. Consider the following constraints: 1: No box contains a ball that has the same colour as the box. 2: No box is empty. Find the number of ways to put 3...
2019/10/01
[ "https://math.stackexchange.com/questions/3376450", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
(I will assume that when you said constraints A and B, you meant 1 and 2 respectively.) a) We first ignore the given constraint and count the number of ways to distribute the 30 balls among the three boxes. Using "Stars and Bars" we can distribute the red balls in $$\binom{10+3-1}{3-1} = \binom{12}{2}$$ ways. The bl...
In case you can fit any number of balls in a box, and all boxes are distinguishable, each colour has $\binom{10+2-1}{10}$ possible allocations. Every allocation is unique, so you don't over count, just take the product to get the solution to 1. The rest should be easy. For the emptiness part note you can't have 2 empt...
3,376,450
We are given a red box, a blue box and a green box, and also given 10 red balls, 10 blue balls, and 10 green balls. Balls of the same color are indistinguishable. Consider the following constraints: 1: No box contains a ball that has the same colour as the box. 2: No box is empty. Find the number of ways to put 3...
2019/10/01
[ "https://math.stackexchange.com/questions/3376450", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I preassume that all balls must be placed in a box and that every box can contain any number of balls that does not exceed $30$. --- * Concerning the constraint that no box contains a ball that has the same colour as the box. The $10$ red balls must be split up in balls that are placed in the blue box an balls that ...
In case you can fit any number of balls in a box, and all boxes are distinguishable, each colour has $\binom{10+2-1}{10}$ possible allocations. Every allocation is unique, so you don't over count, just take the product to get the solution to 1. The rest should be easy. For the emptiness part note you can't have 2 empt...
5,358,583
I am developing a website/online-service for document collaboration that runs on JBoss. During testing on a Linux machine with 2.5Ghz cpu and 2GB RAM the page response is very fast and we are considering to launch with this machine. The problem arises during document processing. After a user uploads a document a new t...
2011/03/18
[ "https://Stackoverflow.com/questions/5358583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/523049/" ]
There's not really a way to allocate a certain percentage of CPU/memory time for a given thread. You could lower the thread priority so it doesn't saturate all resources: ``` int oldPriority = Thread.currentThread().getPriority(); Thread.currentThread().setPriority(Thread.MIN_PRIORITY); // process your documents here ...
After the user has submitted the documents, you could submit them all into a JMS Queue where only a single instance of an MDB is listening to. So document processing will be serial and thus only use one thread (which still could use a lot of CPU). If this solution is not enough, you can put a remote MDB on a different...
1,401,720
I want to compute the time 4 hours later during the DST transition, either into DST or out of it. Currently doing this: ``` DateTime now = DateTime.now(); DateTime later = now.AddHours(4); System.Console.WriteLine(now + " isDST " + now.IsDaylightSavingTime()); System.Console.WriteLine(later + " isDST " + later.IsDayl...
2009/09/09
[ "https://Stackoverflow.com/questions/1401720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/171054/" ]
Changing the file extensions won't change the version of PHP that's installed on the server. If your host only has PHP4 then you can only use PHP4 unless they're willing to give you PHP5. The only way this will work is if your host already has PHP5 running and has it setup to only work with files that have the .php5 ex...
Are you allowed to rewrite those settings per directory with a .htaccess file? If you can, just ask you hosting provider how the setting is made and change it just for you. Something like ``` Action application/x-httpd-php /path/to/php5 ```
3,373,986
I was reading the below link of math.stackexchange. The question is about to solve the limit of a function [Limit of a given function](https://math.stackexchange.com/questions/3372904/given-real-x-geq1-show-that-lim-n-to-infty-2-sqrtn-x-1n-x2) The function is: \begin{equation} f(x) = \lim\_{n \to \infty}{(2\sqrt[n]x-1...
2019/09/29
[ "https://math.stackexchange.com/questions/3373986", "https://math.stackexchange.com", "https://math.stackexchange.com/users/210632/" ]
Your mistake is in thinking that if $a\_n \to 1$ then $a\_n^{n}$ also tends to $1$. This is not true. For example, $(1+\frac 1 n)^{n} \to e$ even though $ 1 +\frac 1n \to 1$.
You must pay attention since when $a\_n\to 1$ we can't conclude that $(a\_n)^n\to 1$. Here is a sligthly different solution: $$(2\sqrt[n]x-1)^n=(1-(2\sqrt[n]x-2))^n=e^{n\log{(1+(2-2\sqrt[n]x))}}\to x^2$$ indeed by standard limits $$n\log{(1+(2-2\sqrt[n]x))}=\frac{\log{(1+(2-2\sqrt[n]x))}}{(2-2\sqrt[n]x))}\cdot n(2-...
229,966
As seen in the image bellow, the help section of the app suggest that bugs are reported to Meta Stack Overflow. Should this be changed now to show Meta Stack Exchange in the next update, or should we still report bugs to Meta Stack Overflow? ![iPhone app help page](https://i.stack.imgur.com/UWgkb.jpg)
2014/04/18
[ "https://meta.stackexchange.com/questions/229966", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/238300/" ]
You should report bugs here. The app will state this too as of the next release. Thanks for spotting this!
You should report bugs and make feature requests on this site, Meta Stack Exchange. Meta Stack Overflow is now a 'normal' per-site meta. Since the app is a network-wide client, questions/bugs/requests about it should be posted here.
5,458,631
I'm increasingly hearing that Python's [Twisted](http://twistedmatrix.com/trac/wiki/TwistedProject) framework rocks and other frameworks pale in comparison. Can anybody shed some light on this and possibly compare Twisted with other network programming frameworks.
2011/03/28
[ "https://Stackoverflow.com/questions/5458631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60188/" ]
There are a lot of different aspects of Twisted that you might find cool. Twisted includes lots and lots of protocol implementations, meaning that more likely than not there will be an API you can use to talk to some remote system (either client or server in most cases) - be it [HTTP](http://twistedmatrix.com/trac/wik...
Well it's probably according to taste. Twisted allows you to easily create event driven network servers/clients, without really worrying about everything that goes into accomplishing this. And thanks to the [MIT License](http://www.opensource.org/licenses/mit-license.php), Twisted can be used almost anywhere. But I h...
10,872,536
In my current project, I am measuring complexity of algorithms written in Java. I operate with asymptotic complexity (expected result) and I want to validate the expectation by comparison with the actual number of operations. Using Incrematation per operation seems to me a bit clumsy awkward. Is there any better approa...
2012/06/03
[ "https://Stackoverflow.com/questions/10872536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508219/" ]
Is there particular reason not to just measure the CPU time? The time utility or a profiler will get you the numbers. Just run each algorithm with a sufficient range of inputs and capture the cpu time (not wall clock time) spent.
[ByCounter](https://sdqweb.ipd.kit.edu/wiki/ByCounter) can be used to instrument Java (across multiple classes) and count the number of bytecodes executed by the JVM at runtime.
10,872,536
In my current project, I am measuring complexity of algorithms written in Java. I operate with asymptotic complexity (expected result) and I want to validate the expectation by comparison with the actual number of operations. Using Incrematation per operation seems to me a bit clumsy awkward. Is there any better approa...
2012/06/03
[ "https://Stackoverflow.com/questions/10872536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508219/" ]
On an actual computer you want to measure execution time, getCurrentTimeMillis(). Vary the N parameter, get solid statistics. Do an error estimate. Your basic least squares will be fine. Counting operations on an algorithm is fine, but it has limited use. Different processors do stuff at different speeds. Counting th...
[ByCounter](https://sdqweb.ipd.kit.edu/wiki/ByCounter) can be used to instrument Java (across multiple classes) and count the number of bytecodes executed by the JVM at runtime.
34,712,472
I have the following code: ``` dict_1= { 'key1':{'key1':[.56,.75], 'key2':[]}, 'key2':{'key1':[.76,.95], 'key2':[]}, 'key3':{'key1':[.96,1.05],'key_2':[]} } def zones_calc(ftp): var_1 = ftp for i in dict_1.iteritems(): for v in i['key_1']: i[key_2.append(var_1 * v)] zones_ca...
2016/01/11
[ "https://Stackoverflow.com/questions/34712472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4357027/" ]
First of all you are using `key_1` to lookup in your dictionary and you don't have any key in your dictionary with `key_1` value, you have multiple `key1` so I'm assuming that's what you want. Secondly you want to indent `i[key_2.append(var_1 * v)]` and change it to something like `value['key2'].append(var_1 * v)`: ag...
Try this: ``` dict_1= { 'key1':{'key1':[.56,.75], 'key2':[]}, 'key2':{'key1':[.76,.95], 'key2':[]}, 'key3':{'key1':[.96,1.05],'key2':[]} } def zones_calc(ftp): var_1 = ftp for v1 in dict_1.values(): for v in v1['key1']: v1['key2'].append(var_1 * v) zones_calc(200) ``` Here's th...
21,140,533
Different hosts have different php.ini settings for `max_execution_time`. When coding a potentially long-running script for a server you don't control (or a hosting environment has not been decided upon yet), what number of seconds can be considered a safe minimum?
2014/01/15
[ "https://Stackoverflow.com/questions/21140533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1809477/" ]
The default for php.ini is: > > max\_execution\_time: "30" > > > <http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time> So, unless the host has decreased this which I wouldn't think they would - I would aim for that. Although it's complete guess work when you don't control the target server...
I would go based on how long you expect something to run. If your script normally takes about `45 secs` to process then you can set a `max_execution_time` to `60` to be safe. It all depends on you. I have a social networking site that is script intensive and runs crons etc so my `max_execution_time` is kinda high to e...
21,140,533
Different hosts have different php.ini settings for `max_execution_time`. When coding a potentially long-running script for a server you don't control (or a hosting environment has not been decided upon yet), what number of seconds can be considered a safe minimum?
2014/01/15
[ "https://Stackoverflow.com/questions/21140533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1809477/" ]
The default for php.ini is: > > max\_execution\_time: "30" > > > <http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time> So, unless the host has decreased this which I wouldn't think they would - I would aim for that. Although it's complete guess work when you don't control the target server...
You can **change the max\_execution\_time**, using the **set\_time\_limit** function (only if php is **not running in safe mode**). <http://www.php.net/manual/en/function.set-time-limit.php> **The default max\_execution\_time is 30 seconds**. <http://www.php.net/manual/en/info.configuration.php#ini.max-executi...
21,140,533
Different hosts have different php.ini settings for `max_execution_time`. When coding a potentially long-running script for a server you don't control (or a hosting environment has not been decided upon yet), what number of seconds can be considered a safe minimum?
2014/01/15
[ "https://Stackoverflow.com/questions/21140533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1809477/" ]
I would go based on how long you expect something to run. If your script normally takes about `45 secs` to process then you can set a `max_execution_time` to `60` to be safe. It all depends on you. I have a social networking site that is script intensive and runs crons etc so my `max_execution_time` is kinda high to e...
You can **change the max\_execution\_time**, using the **set\_time\_limit** function (only if php is **not running in safe mode**). <http://www.php.net/manual/en/function.set-time-limit.php> **The default max\_execution\_time is 30 seconds**. <http://www.php.net/manual/en/info.configuration.php#ini.max-executi...
57,334,347
I'm displaying student data for teachers at my school using SQL, and for usability reasons it needs to be displayed with very unique sorting, with 3 subsets of the alphabet dividing the dataset, then normal sorting within that. It should spit out something like this: Last names A-F, sorted by period, then by last nam...
2019/08/02
[ "https://Stackoverflow.com/questions/57334347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8636782/" ]
Are you looking for a conditional expression in the `order by`? ``` order by (case when last < 'G' then 1 when last < 'P' then 2 else 3 end), per, last ```
You may want to try something like this: ``` SELECT CASE WHEN LEFT(UPPER(last), 1) BETWEEN 'A' AND 'F' THEN 1 WHEN LEFT(UPPER(last), 1) BETWEEN 'G' AND 'O' THEN 2 WHEN LEFT(UPPER(last), 1) BETWEEN 'P' AND 'Z' THEN 3 ELSE 4 END AS LETTER_GROUP, per, last FROM Student ORDER BY 1,2,3; ```
57,334,347
I'm displaying student data for teachers at my school using SQL, and for usability reasons it needs to be displayed with very unique sorting, with 3 subsets of the alphabet dividing the dataset, then normal sorting within that. It should spit out something like this: Last names A-F, sorted by period, then by last nam...
2019/08/02
[ "https://Stackoverflow.com/questions/57334347", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8636782/" ]
Are you looking for a conditional expression in the `order by`? ``` order by (case when last < 'G' then 1 when last < 'P' then 2 else 3 end), per, last ```
You can't really break the result set up into groups/partitions. You can *group* the results set with a `group by` clause, but that summarizes down to a single row per group. There's also `over/partition by`, but that's more analytic. You'll want to do something like this: ``` select group_1 = case ...
20,679,300
I was wondering if it was possible to set, in the xml, the `layout_height` parameter to few dp more than the `wrap_content` value ? For example `wrap_content` + 10 dp Thanks for help in advance
2013/12/19
[ "https://Stackoverflow.com/questions/20679300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3008340/" ]
You can create extra space inside TextView with padding. You can create extra space outside TextView with margin. ![enter image description here](https://i.stack.imgur.com/IrKSd.jpg)
Do one thing, try padding : use `padding` for that. you can add these in your TextView . It will add 5 dp space in left, top, right and bottom. ``` android:padding="5dp" ``` But if you want to add only top and bottom space then add: ``` android:paddingTop="5dp" android:paddingBottom="5dp" ```
20,679,300
I was wondering if it was possible to set, in the xml, the `layout_height` parameter to few dp more than the `wrap_content` value ? For example `wrap_content` + 10 dp Thanks for help in advance
2013/12/19
[ "https://Stackoverflow.com/questions/20679300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3008340/" ]
Do one thing, try padding : use `padding` for that. you can add these in your TextView . It will add 5 dp space in left, top, right and bottom. ``` android:padding="5dp" ``` But if you want to add only top and bottom space then add: ``` android:paddingTop="5dp" android:paddingBottom="5dp" ```
You can achieve this by using padding top attribute. set the text view height to "wrap\_content" set padding attribute as android:paddingTop="10dp" also set gravity as central\_vertical, to align the text central\_vertical inside the text view.
20,679,300
I was wondering if it was possible to set, in the xml, the `layout_height` parameter to few dp more than the `wrap_content` value ? For example `wrap_content` + 10 dp Thanks for help in advance
2013/12/19
[ "https://Stackoverflow.com/questions/20679300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3008340/" ]
You can create extra space inside TextView with padding. You can create extra space outside TextView with margin. ![enter image description here](https://i.stack.imgur.com/IrKSd.jpg)
You can achieve this by using padding top attribute. set the text view height to "wrap\_content" set padding attribute as android:paddingTop="10dp" also set gravity as central\_vertical, to align the text central\_vertical inside the text view.
62,427,102
We are having an interesting issue where we are seeing a CPU spike on our EC2 instance and at the same time we are seeing a spike in disk latency. Here is the pattern for CPU spike 1. CPU spike from 50% to 100% within 30 seconds 2. It stays at 100% utilization for two minutes 3. CPU utilization is dropped from 100 to ...
2020/06/17
[ "https://Stackoverflow.com/questions/62427102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4008473/" ]
Here is my bet: you are running t2 / t3 machines which are burstable instances. You can access 30% of the CPU all the time, and a credit system create a fair usage predictable mode for the 70% remaining. You earn credit by running the instance, you lose credit by going over 30% CPU usage. You are running out of credit...
I would suggest faster storage. cpu aims to add up to 100%. limiting is working in this strange way that it simulates usage for "unknown" reason. Reasons can be one of those: * idle time (notice here this is what you consider FREE cpu, thats why I say it adds up to 100%) * user time (normal usage) * system time (syste...
9,258,793
I have a viewcontroller(say A). I am pushing some viewcontrollers over the first viewcontroller(A). After some tasks, I am switching back to my first view controller(A). That is, I pop to rootviewcontroller(A). But this time my viewcontroller(A) should have an alertview. My question: Is setting a global boolean varia...
2012/02/13
[ "https://Stackoverflow.com/questions/9258793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1167266/" ]
Sure you may use Global NSString(or BOOL) for showing the AlertView when comes to ViewController Here in Below code i used the String variable. Declare a NSString variable in AppDelegate.h Class ``` NSString * checkAlert; //make property of that NSString. @property(retain,nonatomic)NSString * checkAlert; ``` ...
You could also save it in `NSUserDefaults`. In a ViewController: ``` NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; [prefs setBool:YES forKey:@"some_key"]; ``` in an other ViewController in the `viewWillAppear` for example: ``` NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; BOOL va...
9,258,793
I have a viewcontroller(say A). I am pushing some viewcontrollers over the first viewcontroller(A). After some tasks, I am switching back to my first view controller(A). That is, I pop to rootviewcontroller(A). But this time my viewcontroller(A) should have an alertview. My question: Is setting a global boolean varia...
2012/02/13
[ "https://Stackoverflow.com/questions/9258793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1167266/" ]
Sure you may use Global NSString(or BOOL) for showing the AlertView when comes to ViewController Here in Below code i used the String variable. Declare a NSString variable in AppDelegate.h Class ``` NSString * checkAlert; //make property of that NSString. @property(retain,nonatomic)NSString * checkAlert; ``` ...
You can also **set your first view controller as a global variable**, e.g. in your AppDelegate, then you can access it via `(YourAppDelegate*)[UIApplication sharedApplication].firstViewController` and then call a DisplayAlert function on it after popping back to it. Or you can **pass the first view controller** to a...
33,725,639
I'm trying to set up less on phpstorm so I can compile .less files to .css on save. I have installed node.js and the next step (according to this <https://www.jetbrains.com/webstorm/help/transpiling-sass-less-and-scss-to-css.html>) is running this command in the terminal ``` npm install -g less ``` However when I d...
2015/11/15
[ "https://Stackoverflow.com/questions/33725639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3167915/" ]
Try installing with `sudo`. I had a similar problem installing npm package globally. The problem occurs because current use does not have write permissions for making changes in directory. Didn't work ``` npm i -g vsce ``` Worked ``` sudo npm i -g vsce ```
Another option is to download and install a new version using an installer. <https://nodejs.org/en/download/>
33,725,639
I'm trying to set up less on phpstorm so I can compile .less files to .css on save. I have installed node.js and the next step (according to this <https://www.jetbrains.com/webstorm/help/transpiling-sass-less-and-scss-to-css.html>) is running this command in the terminal ``` npm install -g less ``` However when I d...
2015/11/15
[ "https://Stackoverflow.com/questions/33725639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3167915/" ]
Reinstall node and npm with **Node Version Manger** (as per [written in npm documentation](https://docs.npmjs.com/getting-started/fixing-npm-permissions)) to avoid permission errors: In OSX: ``` curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash ``` or follow this article: <http://...
In linux make sure getting all authority with: ``` sudo su ```
33,725,639
I'm trying to set up less on phpstorm so I can compile .less files to .css on save. I have installed node.js and the next step (according to this <https://www.jetbrains.com/webstorm/help/transpiling-sass-less-and-scss-to-css.html>) is running this command in the terminal ``` npm install -g less ``` However when I d...
2015/11/15
[ "https://Stackoverflow.com/questions/33725639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3167915/" ]
Using sudo is not recommended. It may give you permission issue later. While the above works, I am not a fan of changing folders owned by root to be writable for users, although it may only be an issue with multiple users. To work around that, you could use a group, with 'npm users' but that is also more administrative...
You can try with sudo, like the following ``` sudo npm install -g less ``` If it does not work, you can refer to this link <https://ionicframework.com/docs/developing/tips#resolving-permission-errors>
33,725,639
I'm trying to set up less on phpstorm so I can compile .less files to .css on save. I have installed node.js and the next step (according to this <https://www.jetbrains.com/webstorm/help/transpiling-sass-less-and-scss-to-css.html>) is running this command in the terminal ``` npm install -g less ``` However when I d...
2015/11/15
[ "https://Stackoverflow.com/questions/33725639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3167915/" ]
[![enter image description here](https://i.stack.imgur.com/vEvPi.png)](https://i.stack.imgur.com/vEvPi.png)Use sudo -i to switch to $root, then execute npm install -g xxxx
I have got the same problem. updating npm was not working for me either so I just decided to reinstall it. what worked for me is uninstall node from my system using. ``` sudo apt-get remove nodejs sudo apt-get remove npm ``` end then reinstall it after update. ``` sudo apt-get update sudo apt install npm ```
33,725,639
I'm trying to set up less on phpstorm so I can compile .less files to .css on save. I have installed node.js and the next step (according to this <https://www.jetbrains.com/webstorm/help/transpiling-sass-less-and-scss-to-css.html>) is running this command in the terminal ``` npm install -g less ``` However when I d...
2015/11/15
[ "https://Stackoverflow.com/questions/33725639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3167915/" ]
Run these commands in a terminal window (note: DON'T replace the $USER part... thats a linux command to get your user!): ``` sudo chown -R $USER ~/.npm sudo chown -R $USER /usr/lib/node_modules sudo chown -R $USER /usr/local/lib/node_modules ```
In linux make sure getting all authority with: ``` sudo su ```
33,725,639
I'm trying to set up less on phpstorm so I can compile .less files to .css on save. I have installed node.js and the next step (according to this <https://www.jetbrains.com/webstorm/help/transpiling-sass-less-and-scss-to-css.html>) is running this command in the terminal ``` npm install -g less ``` However when I d...
2015/11/15
[ "https://Stackoverflow.com/questions/33725639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3167915/" ]
[![enter image description here](https://i.stack.imgur.com/vEvPi.png)](https://i.stack.imgur.com/vEvPi.png)Use sudo -i to switch to $root, then execute npm install -g xxxx
In linux make sure getting all authority with: ``` sudo su ```
33,725,639
I'm trying to set up less on phpstorm so I can compile .less files to .css on save. I have installed node.js and the next step (according to this <https://www.jetbrains.com/webstorm/help/transpiling-sass-less-and-scss-to-css.html>) is running this command in the terminal ``` npm install -g less ``` However when I d...
2015/11/15
[ "https://Stackoverflow.com/questions/33725639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3167915/" ]
sudo chown -R $USER /usr/local/lib/node\_modules This command will work
In linux make sure getting all authority with: ``` sudo su ```
33,725,639
I'm trying to set up less on phpstorm so I can compile .less files to .css on save. I have installed node.js and the next step (according to this <https://www.jetbrains.com/webstorm/help/transpiling-sass-less-and-scss-to-css.html>) is running this command in the terminal ``` npm install -g less ``` However when I d...
2015/11/15
[ "https://Stackoverflow.com/questions/33725639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3167915/" ]
You can use this command with the root password to add permission for writing for `node_module` folder: ``` sudo chown -R $USER /usr/local/lib/node_modules ```
In linux make sure getting all authority with: ``` sudo su ```
33,725,639
I'm trying to set up less on phpstorm so I can compile .less files to .css on save. I have installed node.js and the next step (according to this <https://www.jetbrains.com/webstorm/help/transpiling-sass-less-and-scss-to-css.html>) is running this command in the terminal ``` npm install -g less ``` However when I d...
2015/11/15
[ "https://Stackoverflow.com/questions/33725639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3167915/" ]
I have tried all the suggested solutions but nothing worked. I am using macOS Catalina 10.15.3 Go to /usr/local/ Select bin folder > Get Info Add your user to Sharing & Permissions. Read & Write Permissions. [![enter image description here](https://i.stack.imgur.com/tNKSJ.png)](https://i.stack.imgur.com/tNKSJ.png) ...
Another option is to download and install a new version using an installer. <https://nodejs.org/en/download/>
33,725,639
I'm trying to set up less on phpstorm so I can compile .less files to .css on save. I have installed node.js and the next step (according to this <https://www.jetbrains.com/webstorm/help/transpiling-sass-less-and-scss-to-css.html>) is running this command in the terminal ``` npm install -g less ``` However when I d...
2015/11/15
[ "https://Stackoverflow.com/questions/33725639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3167915/" ]
Using sudo is not recommended. It may give you permission issue later. While the above works, I am not a fan of changing folders owned by root to be writable for users, although it may only be an issue with multiple users. To work around that, you could use a group, with 'npm users' but that is also more administrative...
I have tried all the suggested solutions but nothing worked. I am using macOS Catalina 10.15.3 Go to /usr/local/ Select bin folder > Get Info Add your user to Sharing & Permissions. Read & Write Permissions. [![enter image description here](https://i.stack.imgur.com/tNKSJ.png)](https://i.stack.imgur.com/tNKSJ.png) ...