qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
6,038,430
The main question is how do I implement startTest() so that it calls runTest in all the subclasses. Thanks! ``` /******************* COMPILER TEST *******************/ class archeTest { protected: short verbosity_; public: void setVerbosity(short v) { if( ((v == 1) || (v == 0) ) {...
2011/05/17
[ "https://Stackoverflow.com/questions/6038430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You might want to check out [UnitTest++](http://unittest-cpp.sourceforge.net/) (you can [browse the source code here](http://unittest-cpp.svn.sourceforge.net/viewvc/unittest-cpp/UnitTest%2B%2B/src/)). Pay particular attention to [`TestMacros.h`](http://unittest-cpp.svn.sourceforge.net/viewvc/unittest-cpp/UnitTest%2B%2B...
EDIT: never mind, my first answer didn't make any sense. In C++, you cannot obtain the list of all subclasses of a class to instantiate them, so I don't think you can implement runTests() the way you want it.
6,038,430
The main question is how do I implement startTest() so that it calls runTest in all the subclasses. Thanks! ``` /******************* COMPILER TEST *******************/ class archeTest { protected: short verbosity_; public: void setVerbosity(short v) { if( ((v == 1) || (v == 0) ) {...
2011/05/17
[ "https://Stackoverflow.com/questions/6038430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Well, first - **single responsibility principle**. That in mind, your `archeTest` shouldn't manage alle test objects. Just have an (in)famous `Manager` do that! ``` #include <vector> class TestManager{ std::vector<archeTest*> _tests; public: // either void AddTest(archeTest* test){ _tests.push_back(test); ...
You might want to check out [UnitTest++](http://unittest-cpp.sourceforge.net/) (you can [browse the source code here](http://unittest-cpp.svn.sourceforge.net/viewvc/unittest-cpp/UnitTest%2B%2B/src/)). Pay particular attention to [`TestMacros.h`](http://unittest-cpp.svn.sourceforge.net/viewvc/unittest-cpp/UnitTest%2B%2B...
6,038,430
The main question is how do I implement startTest() so that it calls runTest in all the subclasses. Thanks! ``` /******************* COMPILER TEST *******************/ class archeTest { protected: short verbosity_; public: void setVerbosity(short v) { if( ((v == 1) || (v == 0) ) {...
2011/05/17
[ "https://Stackoverflow.com/questions/6038430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Well, first - **single responsibility principle**. That in mind, your `archeTest` shouldn't manage alle test objects. Just have an (in)famous `Manager` do that! ``` #include <vector> class TestManager{ std::vector<archeTest*> _tests; public: // either void AddTest(archeTest* test){ _tests.push_back(test); ...
First off, you would declare startTest like this in archeTest. ``` virtual void startTest() = 0; ``` That makes it a pure virtual function that must be implemented in child classes. To call this method on a child class, you must have an object of that particular class instantiated. Then you can call startTest either...
6,038,430
The main question is how do I implement startTest() so that it calls runTest in all the subclasses. Thanks! ``` /******************* COMPILER TEST *******************/ class archeTest { protected: short verbosity_; public: void setVerbosity(short v) { if( ((v == 1) || (v == 0) ) {...
2011/05/17
[ "https://Stackoverflow.com/questions/6038430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
It is possible but to do it you will have to use an abstract factory pattern. Please [read this](http://en.wikipedia.org/wiki/Abstract_factory_pattern) for an overview on what the abstract pattern is and how it can do what you need. If you can use boost in your project then you can implement your own abstract factory ...
You might want to check out [UnitTest++](http://unittest-cpp.sourceforge.net/) (you can [browse the source code here](http://unittest-cpp.svn.sourceforge.net/viewvc/unittest-cpp/UnitTest%2B%2B/src/)). Pay particular attention to [`TestMacros.h`](http://unittest-cpp.svn.sourceforge.net/viewvc/unittest-cpp/UnitTest%2B%2B...
6,038,430
The main question is how do I implement startTest() so that it calls runTest in all the subclasses. Thanks! ``` /******************* COMPILER TEST *******************/ class archeTest { protected: short verbosity_; public: void setVerbosity(short v) { if( ((v == 1) || (v == 0) ) {...
2011/05/17
[ "https://Stackoverflow.com/questions/6038430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Since a lot of people were finding it difficult to follow through all the posts I listed. I implemented a version of this using boost. The trick is the fact that when the definition for TestTemplate is expanded with the derived class definitions(new Test cases) it forces a call to the TestManager::Register method due...
It is possible but to do it you will have to use an abstract factory pattern. Please [read this](http://en.wikipedia.org/wiki/Abstract_factory_pattern) for an overview on what the abstract pattern is and how it can do what you need. If you can use boost in your project then you can implement your own abstract factory ...
99,023
I'm trying to install PyCharm on my Raspberry Pi running Ubuntu Mate. But I don't understand the error message I get. First I followed this tutorial : <https://linuxize.com/post/how-to-install-pycharm-on-ubuntu-18-04/> it was just about writing `python sudo snap install pycharm-community --classic` I received this e...
2019/05/27
[ "https://raspberrypi.stackexchange.com/questions/99023", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/104126/" ]
No, it's not possible to install PyCharm on a Raspberry Pi. The `armhf` error means that the RPi hardware (processor) is not supported by PyCharm. **However:** PyCharm does support remote development (after a fashion) on the RPi, but you will have to install PyCharm on a system that runs on supported hardware (e.g. I...
I know this is an old post but I was searching for the exact same question and fond this answer: <https://www.element14.com/community/community/raspberry-pi/blog/2019/09/12/installing-pycharm-on-raspberry-pi> I have tested it on Twister OS 1.8.2(based on raspberry pi OS) and Ubuntu Mate 20.04 and it works without issu...
5,594,412
I need to calculate the average days within the specified datetime values in sql server which involves the logic day+(hh + mm + ss + mi) as the average time(days). can anybody help me? thanks in advance...
2011/04/08
[ "https://Stackoverflow.com/questions/5594412", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290438/" ]
You can use the [datediff](http://msdn.microsoft.com/en-us/library/ms189794.aspx) function: ``` SELECT DATEDIFF(day, startdate, enddate) FROM myTable ``` That will give you the number of days between two dates. You can get the average with the [AVG](http://msdn.microsoft.com/en-us/library/ms177677.aspx) function: ...
And just in case your enddate may be null, try this ``` select case when (SubscriptionEnd is null) then datediff (day,SubscriptionStart,getdate()) else datediff (day,SubscriptionStart,SubscriptionEnd) end as 'totaldays' from [dbo].[whatever] ```
1,294,387
I have a div tag contain text: ``` <div id="XXX" class="xxx"> fffsdssfdf </div> ``` And the CSS like this: ``` .xxx{ opacity :50; } ``` But the Text doesn't opacity.
2009/08/18
[ "https://Stackoverflow.com/questions/1294387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148978/" ]
Opacity is a CSS 3 propery. It's expressed from 0 - 1.0. So 50% opacity would be like this: ``` .xxx { opacity: 0.5; } ``` It's also not supported in many browsers (IE 6 & IE 7), but there are some workarounds. Examples here: <http://webdesign.about.com/od/css3/a/aa121306.htm>
It depends on your browser. Opacity works for Firefox and Safari. (use "opacity:" instead of "opacity :"). You also have to fix the opacity value, because this value must be defined between 0 and 1. For IE, try : ``` filter: alpha(opacity=85) ```
1,294,387
I have a div tag contain text: ``` <div id="XXX" class="xxx"> fffsdssfdf </div> ``` And the CSS like this: ``` .xxx{ opacity :50; } ``` But the Text doesn't opacity.
2009/08/18
[ "https://Stackoverflow.com/questions/1294387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148978/" ]
For cross browser opacity, you want: ``` { -moz-opacity:.50; filter:alpha(opacity=50); opacity:.50; } ```
It depends on your browser. Opacity works for Firefox and Safari. (use "opacity:" instead of "opacity :"). You also have to fix the opacity value, because this value must be defined between 0 and 1. For IE, try : ``` filter: alpha(opacity=85) ```
1,294,387
I have a div tag contain text: ``` <div id="XXX" class="xxx"> fffsdssfdf </div> ``` And the CSS like this: ``` .xxx{ opacity :50; } ``` But the Text doesn't opacity.
2009/08/18
[ "https://Stackoverflow.com/questions/1294387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148978/" ]
### Cross-browser Solution: Courtesy of <http://davidwalsh.name/css-opacity> ``` .show-50 { -moz-opacity:.50; filter:alpha(opacity=50); opacity:.50; } ``` ### For inclusion of IE8 Courtesy of [Laith Bade](http://www.leithalweapon.geek.nz/) ``` .show-50 { -moz-opacity:.50; -ms-filter:"alpha(opacity...
It depends on your browser. Opacity works for Firefox and Safari. (use "opacity:" instead of "opacity :"). You also have to fix the opacity value, because this value must be defined between 0 and 1. For IE, try : ``` filter: alpha(opacity=85) ```
1,294,387
I have a div tag contain text: ``` <div id="XXX" class="xxx"> fffsdssfdf </div> ``` And the CSS like this: ``` .xxx{ opacity :50; } ``` But the Text doesn't opacity.
2009/08/18
[ "https://Stackoverflow.com/questions/1294387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148978/" ]
Opacity is a CSS 3 propery. It's expressed from 0 - 1.0. So 50% opacity would be like this: ``` .xxx { opacity: 0.5; } ``` It's also not supported in many browsers (IE 6 & IE 7), but there are some workarounds. Examples here: <http://webdesign.about.com/od/css3/a/aa121306.htm>
For those browsers supporting [RGBA](http://www.css3.info/introduction-opacity-rgba/): ``` <!DOCTYPE html> <html> <head> <style type="text/css"> h1 { color: rgba(255, 0, 0, .5/* opacity */); } </style> </head> <body> <h1>RED</h1> </body> </html> ```
1,294,387
I have a div tag contain text: ``` <div id="XXX" class="xxx"> fffsdssfdf </div> ``` And the CSS like this: ``` .xxx{ opacity :50; } ``` But the Text doesn't opacity.
2009/08/18
[ "https://Stackoverflow.com/questions/1294387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148978/" ]
### Cross-browser Solution: Courtesy of <http://davidwalsh.name/css-opacity> ``` .show-50 { -moz-opacity:.50; filter:alpha(opacity=50); opacity:.50; } ``` ### For inclusion of IE8 Courtesy of [Laith Bade](http://www.leithalweapon.geek.nz/) ``` .show-50 { -moz-opacity:.50; -ms-filter:"alpha(opacity...
Opacity is a CSS 3 propery. It's expressed from 0 - 1.0. So 50% opacity would be like this: ``` .xxx { opacity: 0.5; } ``` It's also not supported in many browsers (IE 6 & IE 7), but there are some workarounds. Examples here: <http://webdesign.about.com/od/css3/a/aa121306.htm>
1,294,387
I have a div tag contain text: ``` <div id="XXX" class="xxx"> fffsdssfdf </div> ``` And the CSS like this: ``` .xxx{ opacity :50; } ``` But the Text doesn't opacity.
2009/08/18
[ "https://Stackoverflow.com/questions/1294387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148978/" ]
For cross browser opacity, you want: ``` { -moz-opacity:.50; filter:alpha(opacity=50); opacity:.50; } ```
For those browsers supporting [RGBA](http://www.css3.info/introduction-opacity-rgba/): ``` <!DOCTYPE html> <html> <head> <style type="text/css"> h1 { color: rgba(255, 0, 0, .5/* opacity */); } </style> </head> <body> <h1>RED</h1> </body> </html> ```
1,294,387
I have a div tag contain text: ``` <div id="XXX" class="xxx"> fffsdssfdf </div> ``` And the CSS like this: ``` .xxx{ opacity :50; } ``` But the Text doesn't opacity.
2009/08/18
[ "https://Stackoverflow.com/questions/1294387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148978/" ]
### Cross-browser Solution: Courtesy of <http://davidwalsh.name/css-opacity> ``` .show-50 { -moz-opacity:.50; filter:alpha(opacity=50); opacity:.50; } ``` ### For inclusion of IE8 Courtesy of [Laith Bade](http://www.leithalweapon.geek.nz/) ``` .show-50 { -moz-opacity:.50; -ms-filter:"alpha(opacity...
For those browsers supporting [RGBA](http://www.css3.info/introduction-opacity-rgba/): ``` <!DOCTYPE html> <html> <head> <style type="text/css"> h1 { color: rgba(255, 0, 0, .5/* opacity */); } </style> </head> <body> <h1>RED</h1> </body> </html> ```
1,294,387
I have a div tag contain text: ``` <div id="XXX" class="xxx"> fffsdssfdf </div> ``` And the CSS like this: ``` .xxx{ opacity :50; } ``` But the Text doesn't opacity.
2009/08/18
[ "https://Stackoverflow.com/questions/1294387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148978/" ]
### Cross-browser Solution: Courtesy of <http://davidwalsh.name/css-opacity> ``` .show-50 { -moz-opacity:.50; filter:alpha(opacity=50); opacity:.50; } ``` ### For inclusion of IE8 Courtesy of [Laith Bade](http://www.leithalweapon.geek.nz/) ``` .show-50 { -moz-opacity:.50; -ms-filter:"alpha(opacity...
For cross browser opacity, you want: ``` { -moz-opacity:.50; filter:alpha(opacity=50); opacity:.50; } ```
5,692,286
Given an undirected graph, I want to generate all subgraphs which are trees of size N, where *size* refers to the number of edges in the tree. I am aware that there are a lot of them (exponentially many at least for graphs with constant connectivity) - but that's fine, as I believe the number of nodes and edges makes ...
2011/04/17
[ "https://Stackoverflow.com/questions/5692286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149138/" ]
Unless I'm reading the question wrong people seem to be overcomplicating it. This is just "all possible paths within N edges" and you're allowing cycles. This, for two nodes: A, B and one edge your result would be: AA, AB, BA, BB For two nodes, two edges your result would be: AAA, AAB, ABA, ABB, BAA, BAB, BBA, BBB I ...
I think there is a good algorithm (with Perl implementation) at [this site](http://research.nii.ac.jp/~uno/codes.htm) (look for TGE), but if you want to use it commercially you'll need to contact the author. The algorithm is similar to yours in the question but avoids the recursion explosion by making the procedure inc...
5,692,286
Given an undirected graph, I want to generate all subgraphs which are trees of size N, where *size* refers to the number of edges in the tree. I am aware that there are a lot of them (exponentially many at least for graphs with constant connectivity) - but that's fine, as I believe the number of nodes and edges makes ...
2011/04/17
[ "https://Stackoverflow.com/questions/5692286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149138/" ]
So you have a graph with with edges e\_1, e\_2, ..., e\_E. If I understand correctly, you are looking to enumerate all subgraphs which are trees and contain N edges. A simple solution is to generate each of the E choose N subgraphs and check if they are trees. Have you considered this approach? Of course if E is too ...
I think problem is under-specified. You mentioned that graph is undirected and that subgraph you are trying to find is of size N. What is missing is number of edges and whenever trees you are looking for binary or you allowed to have multi-trees. Also - are you interested in mirrored reflections of same tree, or in oth...
5,692,286
Given an undirected graph, I want to generate all subgraphs which are trees of size N, where *size* refers to the number of edges in the tree. I am aware that there are a lot of them (exponentially many at least for graphs with constant connectivity) - but that's fine, as I believe the number of nodes and edges makes ...
2011/04/17
[ "https://Stackoverflow.com/questions/5692286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149138/" ]
If memory is the biggest problem you can use a NP-ish solution using tools from formal verification. I.e., *guess* a subset of nodes of size N and check whether it's a graph or not. To save space you can use a BDD (http://en.wikipedia.org/wiki/Binary\_decision\_diagram) to represent the original graph's nodes and edges...
I think there is a good algorithm (with Perl implementation) at [this site](http://research.nii.ac.jp/~uno/codes.htm) (look for TGE), but if you want to use it commercially you'll need to contact the author. The algorithm is similar to yours in the question but avoids the recursion explosion by making the procedure inc...
5,692,286
Given an undirected graph, I want to generate all subgraphs which are trees of size N, where *size* refers to the number of edges in the tree. I am aware that there are a lot of them (exponentially many at least for graphs with constant connectivity) - but that's fine, as I believe the number of nodes and edges makes ...
2011/04/17
[ "https://Stackoverflow.com/questions/5692286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149138/" ]
Assuming you can destroy the original graph or make a destroyable copy I came up to something that could work but could be utter sadomaso because I did not calculate its O-Ntiness. It probably would work for small subtrees. * do it in steps, at each step: * sort the graph nodes so you get a list of nodes sorted by num...
I think problem is under-specified. You mentioned that graph is undirected and that subgraph you are trying to find is of size N. What is missing is number of edges and whenever trees you are looking for binary or you allowed to have multi-trees. Also - are you interested in mirrored reflections of same tree, or in oth...
5,692,286
Given an undirected graph, I want to generate all subgraphs which are trees of size N, where *size* refers to the number of edges in the tree. I am aware that there are a lot of them (exponentially many at least for graphs with constant connectivity) - but that's fine, as I believe the number of nodes and edges makes ...
2011/04/17
[ "https://Stackoverflow.com/questions/5692286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149138/" ]
Assuming you can destroy the original graph or make a destroyable copy I came up to something that could work but could be utter sadomaso because I did not calculate its O-Ntiness. It probably would work for small subtrees. * do it in steps, at each step: * sort the graph nodes so you get a list of nodes sorted by num...
Your solution as is doesn't work I think, although it can be made to work. The main problem is that the subproblems may produce overlapping trees so when you take the union of them you don't end up with a tree of size n. You can reject all solutions where there is an overlap, but you may end up doing a lot more work th...
5,692,286
Given an undirected graph, I want to generate all subgraphs which are trees of size N, where *size* refers to the number of edges in the tree. I am aware that there are a lot of them (exponentially many at least for graphs with constant connectivity) - but that's fine, as I believe the number of nodes and edges makes ...
2011/04/17
[ "https://Stackoverflow.com/questions/5692286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149138/" ]
For a graph of **Kn** there are approximately **n!** paths between any two pairs of vertices. I haven't gone through your code but here is what I would do. 1. Select a pair of vertices. 2. Start from a vertex and try to reach the destination vertex recursively (something like dfs but not exactly). I think this would o...
I think problem is under-specified. You mentioned that graph is undirected and that subgraph you are trying to find is of size N. What is missing is number of edges and whenever trees you are looking for binary or you allowed to have multi-trees. Also - are you interested in mirrored reflections of same tree, or in oth...
5,692,286
Given an undirected graph, I want to generate all subgraphs which are trees of size N, where *size* refers to the number of edges in the tree. I am aware that there are a lot of them (exponentially many at least for graphs with constant connectivity) - but that's fine, as I believe the number of nodes and edges makes ...
2011/04/17
[ "https://Stackoverflow.com/questions/5692286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149138/" ]
If memory is the biggest problem you can use a NP-ish solution using tools from formal verification. I.e., *guess* a subset of nodes of size N and check whether it's a graph or not. To save space you can use a BDD (http://en.wikipedia.org/wiki/Binary\_decision\_diagram) to represent the original graph's nodes and edges...
It seems that the following solution will work. Go over all partitions into two parts of the set of all vertices. Then count the number of edges which endings lie in different parts (k); these edges correspond to the edge of the tree, they connect subtrees for the first and the second parts. Calculate the answer for b...
5,692,286
Given an undirected graph, I want to generate all subgraphs which are trees of size N, where *size* refers to the number of edges in the tree. I am aware that there are a lot of them (exponentially many at least for graphs with constant connectivity) - but that's fine, as I believe the number of nodes and edges makes ...
2011/04/17
[ "https://Stackoverflow.com/questions/5692286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149138/" ]
This needs an amount of memory that is proportional to what is required to store the graph. It will return every subgraph that is a tree of the desired size exactly once. Keep in mind that I just typed it into here. There could be bugs. But the idea is that you walk the nodes one at a time, for each node searching for...
I think problem is under-specified. You mentioned that graph is undirected and that subgraph you are trying to find is of size N. What is missing is number of edges and whenever trees you are looking for binary or you allowed to have multi-trees. Also - are you interested in mirrored reflections of same tree, or in oth...
5,692,286
Given an undirected graph, I want to generate all subgraphs which are trees of size N, where *size* refers to the number of edges in the tree. I am aware that there are a lot of them (exponentially many at least for graphs with constant connectivity) - but that's fine, as I believe the number of nodes and edges makes ...
2011/04/17
[ "https://Stackoverflow.com/questions/5692286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149138/" ]
This needs an amount of memory that is proportional to what is required to store the graph. It will return every subgraph that is a tree of the desired size exactly once. Keep in mind that I just typed it into here. There could be bugs. But the idea is that you walk the nodes one at a time, for each node searching for...
It seems that the following solution will work. Go over all partitions into two parts of the set of all vertices. Then count the number of edges which endings lie in different parts (k); these edges correspond to the edge of the tree, they connect subtrees for the first and the second parts. Calculate the answer for b...
5,692,286
Given an undirected graph, I want to generate all subgraphs which are trees of size N, where *size* refers to the number of edges in the tree. I am aware that there are a lot of them (exponentially many at least for graphs with constant connectivity) - but that's fine, as I believe the number of nodes and edges makes ...
2011/04/17
[ "https://Stackoverflow.com/questions/5692286", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149138/" ]
This needs an amount of memory that is proportional to what is required to store the graph. It will return every subgraph that is a tree of the desired size exactly once. Keep in mind that I just typed it into here. There could be bugs. But the idea is that you walk the nodes one at a time, for each node searching for...
I think there is a good algorithm (with Perl implementation) at [this site](http://research.nii.ac.jp/~uno/codes.htm) (look for TGE), but if you want to use it commercially you'll need to contact the author. The algorithm is similar to yours in the question but avoids the recursion explosion by making the procedure inc...
297,337
I've run into a problem where I have two very large layers that I'm tasked to overlay on a map, showing cellular coverage across a the whole South Africa. Layer 1 was given to me in various formats and it was really easy to work via the Javascript API after getting it into a fusion table. Layer 2 is my struggle curr...
2018/09/28
[ "https://gis.stackexchange.com/questions/297337", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/129044/" ]
If you recognize the map area on google, then it is easy to pick-up the lat longs(though they may be cross-checked from known sources) from it and you can proceed with the georeferencing. Best of luck, sekhar
Details given by [Clifford C Mugnier](https://www.asprs.org/wp-content/uploads/2018/03/06-17-GD-Philippines.pdf) and the map collar: Projection: Polyconic projection Center of projection: 122° East Map units: us-yards False Easting: 1000000 yards Datum: Luzon (approximate) I get good soultions with this custom CRS: ...
12,290,187
I have two textboxes and two submit buttons. Each button submits the information in the textbox, I would like to have 1 submit button that submits both texboxes at once without. The problem is, if one textbox is empty then it overwrites the data with empty data. I would like it only to submit information if there's som...
2012/09/05
[ "https://Stackoverflow.com/questions/12290187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1440208/" ]
[Apparently](https://developers.google.com/checkout/articles/Google_Checkout_Articles_Zip_Level_Taxes) Google uses data from [these folks](http://www.taxdatasystems.com/) -- they offer db- and web service-based lookups. The integration with Expresso is left as an exercise for the reader ;)
At the moment you would need to write your own extension to have tax based at the zipcode level. The easiest way would be to add a new table that has zipcodes and their respective tax rate. Then with the store\_order\_taxes ( <https://exp-resso.com/docs/extension_hooks.html#tax_hooks> ) hook build an extension that che...
35,528
I am building a website, and my designer came up with the idea of using a (3d) tag cloud to display the different actions a user can take (the site's functionality is somewhat complex, and so explaining its functionality is one of the main challenges). On one hand the idea seems really compelling as it is an interact...
2013/02/27
[ "https://ux.stackexchange.com/questions/35528", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1831/" ]
Text is a structured form of information, and to get at the information your brain has to process it. Processing text in a tag cloud (even a 2D one) presents a much **higher cognitive load** than a simple list. A 3D tag cloud would present an even higher cognitive load, and is something that I would not recommend. Tag...
A 3d tag cloud is an interesting concept/idea, but unless you are exploring or presenting some complex relationship then most of it will just end up as being too visually complex and not necessarily all that usable. I guess there are always going to be people who like 3d bar charts because they are visually stimulated ...
35,528
I am building a website, and my designer came up with the idea of using a (3d) tag cloud to display the different actions a user can take (the site's functionality is somewhat complex, and so explaining its functionality is one of the main challenges). On one hand the idea seems really compelling as it is an interact...
2013/02/27
[ "https://ux.stackexchange.com/questions/35528", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1831/" ]
Text is a structured form of information, and to get at the information your brain has to process it. Processing text in a tag cloud (even a 2D one) presents a much **higher cognitive load** than a simple list. A 3D tag cloud would present an even higher cognitive load, and is something that I would not recommend. Tag...
Tag clouds should not be used for tags, much less for website functions. One of your problems could be > > the site's functionality is somewhat complex, and so explaining its > functionality is one of the main challenges). > > > Taking a complicated problem, and adding a complicated way of displaying that pro...
35,528
I am building a website, and my designer came up with the idea of using a (3d) tag cloud to display the different actions a user can take (the site's functionality is somewhat complex, and so explaining its functionality is one of the main challenges). On one hand the idea seems really compelling as it is an interact...
2013/02/27
[ "https://ux.stackexchange.com/questions/35528", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1831/" ]
*Initial disclaimer: My post may at first look seem a bit hard, but it's all in the best of interest in helping a UX.SE user in need.* --- Yes you confuse users, and you confuse me. I'm not really sure what problem the tag cloud would solve, as opposed to any other control. From your explaination, you're building som...
A 3d tag cloud is an interesting concept/idea, but unless you are exploring or presenting some complex relationship then most of it will just end up as being too visually complex and not necessarily all that usable. I guess there are always going to be people who like 3d bar charts because they are visually stimulated ...
35,528
I am building a website, and my designer came up with the idea of using a (3d) tag cloud to display the different actions a user can take (the site's functionality is somewhat complex, and so explaining its functionality is one of the main challenges). On one hand the idea seems really compelling as it is an interact...
2013/02/27
[ "https://ux.stackexchange.com/questions/35528", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1831/" ]
*Initial disclaimer: My post may at first look seem a bit hard, but it's all in the best of interest in helping a UX.SE user in need.* --- Yes you confuse users, and you confuse me. I'm not really sure what problem the tag cloud would solve, as opposed to any other control. From your explaination, you're building som...
Tag clouds should not be used for tags, much less for website functions. One of your problems could be > > the site's functionality is somewhat complex, and so explaining its > functionality is one of the main challenges). > > > Taking a complicated problem, and adding a complicated way of displaying that pro...
35,528
I am building a website, and my designer came up with the idea of using a (3d) tag cloud to display the different actions a user can take (the site's functionality is somewhat complex, and so explaining its functionality is one of the main challenges). On one hand the idea seems really compelling as it is an interact...
2013/02/27
[ "https://ux.stackexchange.com/questions/35528", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/1831/" ]
A 3d tag cloud is an interesting concept/idea, but unless you are exploring or presenting some complex relationship then most of it will just end up as being too visually complex and not necessarily all that usable. I guess there are always going to be people who like 3d bar charts because they are visually stimulated ...
Tag clouds should not be used for tags, much less for website functions. One of your problems could be > > the site's functionality is somewhat complex, and so explaining its > functionality is one of the main challenges). > > > Taking a complicated problem, and adding a complicated way of displaying that pro...
16,851
SRBs and missiles use [grain](https://space.stackexchange.com/questions/14107/ways-to-obtain-thrust-curves-of-different-grain-geometries) to regulate thrust over time, as only exposed surface of the propellant burns. But what causes propellant to burn only on the surface, and regulates the speed at which the surface b...
2016/06/27
[ "https://space.stackexchange.com/questions/16851", "https://space.stackexchange.com", "https://space.stackexchange.com/users/103/" ]
If we have a pressure shock front travelling very fast through the material it is an explosion. The reaction inside the explosive is started by the sudden pressure rise, not by a temperature rise. But when the solid rocket fuel burns, we have a nearly constant pressure inside the rocket and no travelling shock front. T...
Surface area, pure and simple. The more surface area visible, the faster the burning will occur. As to what separates them from explosives, it is that the propellant is so tightly bound that only the surface can burn. If there are cracks, then solid rockets can in fact explode, so they are very carefully manufactured...
16,851
SRBs and missiles use [grain](https://space.stackexchange.com/questions/14107/ways-to-obtain-thrust-curves-of-different-grain-geometries) to regulate thrust over time, as only exposed surface of the propellant burns. But what causes propellant to burn only on the surface, and regulates the speed at which the surface b...
2016/06/27
[ "https://space.stackexchange.com/questions/16851", "https://space.stackexchange.com", "https://space.stackexchange.com/users/103/" ]
A propellant deflagrates, rather than explodes. The difference between them is that deflagration relies on the thermal energy of the flame front, rather than the energy of the shockwave caused by detonation. The key to this process is a [balance](https://en.wikipedia.org/wiki/Deflagration#Flame_physics) between two fa...
Surface area, pure and simple. The more surface area visible, the faster the burning will occur. As to what separates them from explosives, it is that the propellant is so tightly bound that only the surface can burn. If there are cracks, then solid rockets can in fact explode, so they are very carefully manufactured...
16,851
SRBs and missiles use [grain](https://space.stackexchange.com/questions/14107/ways-to-obtain-thrust-curves-of-different-grain-geometries) to regulate thrust over time, as only exposed surface of the propellant burns. But what causes propellant to burn only on the surface, and regulates the speed at which the surface b...
2016/06/27
[ "https://space.stackexchange.com/questions/16851", "https://space.stackexchange.com", "https://space.stackexchange.com/users/103/" ]
I've asked [the same question](https://chemistry.stackexchange.com/questions/54282/how-is-combustion-speed-regulated-in-solid-propellants) on Chemistry.SE and got some more factors than mentioned in the answers here. * flexible binding agent (rubber), that prevents forming cracks under pressure, is essential to mainta...
Surface area, pure and simple. The more surface area visible, the faster the burning will occur. As to what separates them from explosives, it is that the propellant is so tightly bound that only the surface can burn. If there are cracks, then solid rockets can in fact explode, so they are very carefully manufactured...
16,851
SRBs and missiles use [grain](https://space.stackexchange.com/questions/14107/ways-to-obtain-thrust-curves-of-different-grain-geometries) to regulate thrust over time, as only exposed surface of the propellant burns. But what causes propellant to burn only on the surface, and regulates the speed at which the surface b...
2016/06/27
[ "https://space.stackexchange.com/questions/16851", "https://space.stackexchange.com", "https://space.stackexchange.com/users/103/" ]
If we have a pressure shock front travelling very fast through the material it is an explosion. The reaction inside the explosive is started by the sudden pressure rise, not by a temperature rise. But when the solid rocket fuel burns, we have a nearly constant pressure inside the rocket and no travelling shock front. T...
Looking through the description of [APCP](https://en.wikipedia.org/wiki/Ammonium_perchlorate_composite_propellant), I noticed that it contains metal *powder*. That means your assumption about the oxidizer isn't correct. At microscopic level, the oxidizer is *not* distributed throughout the volume of the metal. The dist...
16,851
SRBs and missiles use [grain](https://space.stackexchange.com/questions/14107/ways-to-obtain-thrust-curves-of-different-grain-geometries) to regulate thrust over time, as only exposed surface of the propellant burns. But what causes propellant to burn only on the surface, and regulates the speed at which the surface b...
2016/06/27
[ "https://space.stackexchange.com/questions/16851", "https://space.stackexchange.com", "https://space.stackexchange.com/users/103/" ]
If we have a pressure shock front travelling very fast through the material it is an explosion. The reaction inside the explosive is started by the sudden pressure rise, not by a temperature rise. But when the solid rocket fuel burns, we have a nearly constant pressure inside the rocket and no travelling shock front. T...
A propellant deflagrates, rather than explodes. The difference between them is that deflagration relies on the thermal energy of the flame front, rather than the energy of the shockwave caused by detonation. The key to this process is a [balance](https://en.wikipedia.org/wiki/Deflagration#Flame_physics) between two fa...
16,851
SRBs and missiles use [grain](https://space.stackexchange.com/questions/14107/ways-to-obtain-thrust-curves-of-different-grain-geometries) to regulate thrust over time, as only exposed surface of the propellant burns. But what causes propellant to burn only on the surface, and regulates the speed at which the surface b...
2016/06/27
[ "https://space.stackexchange.com/questions/16851", "https://space.stackexchange.com", "https://space.stackexchange.com/users/103/" ]
A propellant deflagrates, rather than explodes. The difference between them is that deflagration relies on the thermal energy of the flame front, rather than the energy of the shockwave caused by detonation. The key to this process is a [balance](https://en.wikipedia.org/wiki/Deflagration#Flame_physics) between two fa...
Looking through the description of [APCP](https://en.wikipedia.org/wiki/Ammonium_perchlorate_composite_propellant), I noticed that it contains metal *powder*. That means your assumption about the oxidizer isn't correct. At microscopic level, the oxidizer is *not* distributed throughout the volume of the metal. The dist...
16,851
SRBs and missiles use [grain](https://space.stackexchange.com/questions/14107/ways-to-obtain-thrust-curves-of-different-grain-geometries) to regulate thrust over time, as only exposed surface of the propellant burns. But what causes propellant to burn only on the surface, and regulates the speed at which the surface b...
2016/06/27
[ "https://space.stackexchange.com/questions/16851", "https://space.stackexchange.com", "https://space.stackexchange.com/users/103/" ]
I've asked [the same question](https://chemistry.stackexchange.com/questions/54282/how-is-combustion-speed-regulated-in-solid-propellants) on Chemistry.SE and got some more factors than mentioned in the answers here. * flexible binding agent (rubber), that prevents forming cracks under pressure, is essential to mainta...
Looking through the description of [APCP](https://en.wikipedia.org/wiki/Ammonium_perchlorate_composite_propellant), I noticed that it contains metal *powder*. That means your assumption about the oxidizer isn't correct. At microscopic level, the oxidizer is *not* distributed throughout the volume of the metal. The dist...
16,851
SRBs and missiles use [grain](https://space.stackexchange.com/questions/14107/ways-to-obtain-thrust-curves-of-different-grain-geometries) to regulate thrust over time, as only exposed surface of the propellant burns. But what causes propellant to burn only on the surface, and regulates the speed at which the surface b...
2016/06/27
[ "https://space.stackexchange.com/questions/16851", "https://space.stackexchange.com", "https://space.stackexchange.com/users/103/" ]
I've asked [the same question](https://chemistry.stackexchange.com/questions/54282/how-is-combustion-speed-regulated-in-solid-propellants) on Chemistry.SE and got some more factors than mentioned in the answers here. * flexible binding agent (rubber), that prevents forming cracks under pressure, is essential to mainta...
A propellant deflagrates, rather than explodes. The difference between them is that deflagration relies on the thermal energy of the flame front, rather than the energy of the shockwave caused by detonation. The key to this process is a [balance](https://en.wikipedia.org/wiki/Deflagration#Flame_physics) between two fa...
21,896,580
So I've got a project I'm working on. This is the only error I have: > > Cannot implicitly convert type 'float' to 'int'. > > > I understand somewhat what that means. I just need help converting my float to int. This is just an example of one of the floats: ``` float key = 0.5f; int key = 53; ``` Here's the s...
2014/02/20
[ "https://Stackoverflow.com/questions/21896580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3325320/" ]
Firstly, there are *integers* and *floating-point* numbers. Integers are *always* whole numbers, such as `0`, `1`, `-32`, `42` and `1337`. On the other hand, floating-point numbers *can* have a fractional part: `0`, `1`, `-32.1`, `42.7` and `123.456788` are all valid floating-point numbers. When converting between int...
Try this : ``` int numInt = (int)Math.Ceiling(numFloat); ``` [msdn documentation](http://msdn.microsoft.com/fr-fr/library/zx4t0t48%28v=vs.110%29.aspx) You may want `Math.Round()` or `Math.Floor()` by the way. Example : ``` float numFloat = 1.5f; int testCeiling = (int)Math.Ceiling(numFloat); int testFloor = (int...
5,232,219
I am using a observer to separate the unrelated logic from the model. The scenario is, suppose a record is created or updated in a model, then how can we get that record object in the model's observer's after\_save method?
2011/03/08
[ "https://Stackoverflow.com/questions/5232219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236532/" ]
Try like this in your observer... ``` def after_save(model) --- # model will the current model object --- end ```
This observer method is going to be deprecated.. use this `Model << ActiveXXXXX after_save :after_save_callback` def after\_save\_callback ------------------------- #things to be done ------------------ end
35,567,666
--- Hola, I am trying to get the maps to work, it appears to work fine the the Nexus 6 emulator, however when I run it on a Moto G or a Samsung Galaxy the map is completely bank - it just contains the google logo in the bottom corner. I have generated a google maps key and put that in my google\_maps\_api.xml file. ...
2016/02/23
[ "https://Stackoverflow.com/questions/35567666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5387193/" ]
This line in your logcat seems to be the problems: ``` 02-23 10:02:01.591 5760-5760/com.companyperth.companytools E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.goo...
Try to update your google map. I think that is the issue.
22,130,983
I have the following input data frame: ``` df1 <- data.frame(row.names=c("AA","BB","CC","DD","EE"), A=c(0.90,0.75,0.65,0.55,0.45), B=c(0.80,0.75,0.60,0.60,0.45)) Row A B AA 0.90 0.80 BB 0.75 0.75 CC 0.65 0.60 DD 0.55 0.60 EE 0.45 0.45 ``` Is there a way to divide the values in row AA by the value in ro...
2014/03/02
[ "https://Stackoverflow.com/questions/22130983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1358630/" ]
You could use a simple `for` loop or `cumprod`: ``` df2 <- df1 for (i in 2:nrow(df2)) { df2[i, ] <- df2[i-1,]/df2[i,] } ``` Depending on your number of columns the `cumprod` approach should be a lot of faster: ``` df3 <- df1 df3$A <- cumprod(c(df3[1, "A"], 1/df3[-1, "A"])) df3$B <- cumprod(c(df3[1, "B"], 1/df3[-1...
I would use `Reduce` on each column, with `accumulate = TRUE` ``` as.data.frame(lapply(df1, Reduce, f = `/`, accumulate = TRUE)) ``` (row names are lost in the process, but I bet you'll know what to do to get them back.)
587,996
I just asked a question about how the Erlang compiler implements pattern matching, and I got some great responses, one of which is the compiled bytecode (obtained with a parameter passed to the `c()` directive): ``` {function, match, 1, 2}. {label,1}. {func_info,{atom,match},{atom,match},1}. {label,2}. {te...
2009/02/25
[ "https://Stackoverflow.com/questions/587996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51923/" ]
ok so I dug into the compiler source code to find the answer, and to my surprise the asm file produced with the 'S' parameter to the compile:file() function is actually consulted in as is (file:consult()) and then the tuples are checked one by one for further action(line 661 - beam\_consult\_asm(St) -> - compile.erl). ...
The compiler has a so-called *pattern match compiler* which will take a pattern and compile it down to what is essentially a series of branches, switches and such. The code for Erlang is in `v3_kernel.erl` in the compiler. It uses Simon Peyton Jones, "The Implementation of Functional Programming Languages", available o...
12,944,952
Does anyone know why, in this example, the click event is not being fired only in IE8? Basically, the css style after a click (`.zui-act`) should change the `background-color` of the `label`. [JSFIDDLE](http://jsfiddle.net/7dFeS/) ``` <div style="width:300px;"> <input type="radio" name="a" id="a" value="alpha" /> ...
2012/10/17
[ "https://Stackoverflow.com/questions/12944952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/574998/" ]
I think you almost solved your own problem. I would retrieve the number of record ``` Integer singleResult = em.createQuery("SELECT count(r) FROM RealEstate r", Integer.class).getSingleResult(); ``` Then, I would create a random number out of that and finally ``` Random random = new Random(); RealEsta...
i would do something like this for ***random data*** ``` SELECT column FROM table ORDER BY RAND () ``` thank to javatpoint nice tutorial [javatpoint take a look at here](http://www.javatpoint.com/sql-order-by-random)
58,632,826
I am beginning to study Computational Logic, and as an exercise, I want to prove the correctness of merge sort algorithm. Currently, I’m having difficulties to prove that the output of this algorithm will always correspond to a permutation of a given input. I’d be very glad if someone can assist me with this. Thank ...
2019/10/30
[ "https://Stackoverflow.com/questions/58632826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12299517/" ]
The core of this proof will need to show that the "merge" procedure inserts each element once and only once into the result. Since the merge procedure works using a loop, you need to use a [loop invariant](https://en.wikipedia.org/wiki/Loop_invariant) to show this. Loop invariants can usually be discovered by asking, ...
What are the preconditions of a merge sort? What are the post conditions? Do you have any loop invariants? These are the three questions you have to ask yourself before you can start writing your proof. Then: what are your base cases? Presumably you know how merge sort works if you are working on a proof, so what h...
135,873
I have an idea that the seas of a world are red, not blue. However, the world should also be the birthplace of an intelligent alien species. Would it be scientifically possible to have a world with a red sea and where intelligent life can still develop?
2019/01/07
[ "https://worldbuilding.stackexchange.com/questions/135873", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/55800/" ]
Sure. Just have a microorganism endemic to the seas that colours them red. Some sort of algae, maybe, that produces a red dye naturally as part of their life cycle. We kind of have that here on earth, manifesting as a [red tide](https://en.wikipedia.org/wiki/Red_tide) during algal blooms. If the coloration is produced...
The reason our own ocean is blue is because of the color of the sky. If your sky is red/orange, you might end up with a red ocean. You could also do what a couple others have said and try an alga that's red.
135,873
I have an idea that the seas of a world are red, not blue. However, the world should also be the birthplace of an intelligent alien species. Would it be scientifically possible to have a world with a red sea and where intelligent life can still develop?
2019/01/07
[ "https://worldbuilding.stackexchange.com/questions/135873", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/55800/" ]
Absolutely. [There's actually a sea on Earth which is red(ish)](https://www.livescience.com/32112-is-the-red-sea-really-red.html). So it wouldn't take that much extrapolation to extend the algae planetwide and make it a brighter color. I'd think you'd want it to be loosely matted enough to provide flow of oxygen and s...
If the oceans contain very high concentrations of iron, in the form of rust, it would create a red ocean. This environment would be ideal for [rust-eating microbes](http://www.nbcnews.com/id/40533835/ns/technology_and_science-science/t/new-species-rust-eating-bacteria-destroying-titanic/), which could form the base o...
135,873
I have an idea that the seas of a world are red, not blue. However, the world should also be the birthplace of an intelligent alien species. Would it be scientifically possible to have a world with a red sea and where intelligent life can still develop?
2019/01/07
[ "https://worldbuilding.stackexchange.com/questions/135873", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/55800/" ]
Sure. Just have a microorganism endemic to the seas that colours them red. Some sort of algae, maybe, that produces a red dye naturally as part of their life cycle. We kind of have that here on earth, manifesting as a [red tide](https://en.wikipedia.org/wiki/Red_tide) during algal blooms. If the coloration is produced...
If the oceans contain very high concentrations of iron, in the form of rust, it would create a red ocean. This environment would be ideal for [rust-eating microbes](http://www.nbcnews.com/id/40533835/ns/technology_and_science-science/t/new-species-rust-eating-bacteria-destroying-titanic/), which could form the base o...
135,873
I have an idea that the seas of a world are red, not blue. However, the world should also be the birthplace of an intelligent alien species. Would it be scientifically possible to have a world with a red sea and where intelligent life can still develop?
2019/01/07
[ "https://worldbuilding.stackexchange.com/questions/135873", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/55800/" ]
Absolutely. [There's actually a sea on Earth which is red(ish)](https://www.livescience.com/32112-is-the-red-sea-really-red.html). So it wouldn't take that much extrapolation to extend the algae planetwide and make it a brighter color. I'd think you'd want it to be loosely matted enough to provide flow of oxygen and s...
If you want a really exotic answer, perhaps your world has a [Fluorescein](https://en.wikipedia.org/wiki/Fluorescein) ocean. Fluorescein is in essence a complex carbohydrate, or in other words an organic compound, that naturally 'red-shifts' light, absorbing photons and releasing longer wavelength, lower energy photons...
135,873
I have an idea that the seas of a world are red, not blue. However, the world should also be the birthplace of an intelligent alien species. Would it be scientifically possible to have a world with a red sea and where intelligent life can still develop?
2019/01/07
[ "https://worldbuilding.stackexchange.com/questions/135873", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/55800/" ]
Absolutely. [There's actually a sea on Earth which is red(ish)](https://www.livescience.com/32112-is-the-red-sea-really-red.html). So it wouldn't take that much extrapolation to extend the algae planetwide and make it a brighter color. I'd think you'd want it to be loosely matted enough to provide flow of oxygen and s...
The reason our own ocean is blue is because of the color of the sky. If your sky is red/orange, you might end up with a red ocean. You could also do what a couple others have said and try an alga that's red.
135,873
I have an idea that the seas of a world are red, not blue. However, the world should also be the birthplace of an intelligent alien species. Would it be scientifically possible to have a world with a red sea and where intelligent life can still develop?
2019/01/07
[ "https://worldbuilding.stackexchange.com/questions/135873", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/55800/" ]
I decided to delete my comment and answer the question. Here's your problem: [![enter image description here](https://i.stack.imgur.com/tlSDz.gif)](https://i.stack.imgur.com/tlSDz.gif) This is a chart of color absorption for water. It shows that blue is reflected very well (water doesn't absorb blue). On the otherha...
The reason our own ocean is blue is because of the color of the sky. If your sky is red/orange, you might end up with a red ocean. You could also do what a couple others have said and try an alga that's red.
135,873
I have an idea that the seas of a world are red, not blue. However, the world should also be the birthplace of an intelligent alien species. Would it be scientifically possible to have a world with a red sea and where intelligent life can still develop?
2019/01/07
[ "https://worldbuilding.stackexchange.com/questions/135873", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/55800/" ]
Sure. Just have a microorganism endemic to the seas that colours them red. Some sort of algae, maybe, that produces a red dye naturally as part of their life cycle. We kind of have that here on earth, manifesting as a [red tide](https://en.wikipedia.org/wiki/Red_tide) during algal blooms. If the coloration is produced...
***Your Ocean has a high hemoglobin content*** I would suggest using some sort of symbiotic system where said ocean thermally convects hemoglobin to the surface where it absorbs Oxygen from the atmosphere. This would create a bright red color. The convection along with the weight of the molecule could then cause it to...
135,873
I have an idea that the seas of a world are red, not blue. However, the world should also be the birthplace of an intelligent alien species. Would it be scientifically possible to have a world with a red sea and where intelligent life can still develop?
2019/01/07
[ "https://worldbuilding.stackexchange.com/questions/135873", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/55800/" ]
Absolutely. [There's actually a sea on Earth which is red(ish)](https://www.livescience.com/32112-is-the-red-sea-really-red.html). So it wouldn't take that much extrapolation to extend the algae planetwide and make it a brighter color. I'd think you'd want it to be loosely matted enough to provide flow of oxygen and s...
***Your Ocean has a high hemoglobin content*** I would suggest using some sort of symbiotic system where said ocean thermally convects hemoglobin to the surface where it absorbs Oxygen from the atmosphere. This would create a bright red color. The convection along with the weight of the molecule could then cause it to...
135,873
I have an idea that the seas of a world are red, not blue. However, the world should also be the birthplace of an intelligent alien species. Would it be scientifically possible to have a world with a red sea and where intelligent life can still develop?
2019/01/07
[ "https://worldbuilding.stackexchange.com/questions/135873", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/55800/" ]
There are two easy ways: 1. The color "blue" is partially a function of light reflected by the sky. If the sky is red to the human eye, say due to dust, the water will be reddish. 2. On Earth, Chlorophyll (the green component of plants) actually reflects more red light than green. Our eyes are more sensitive to the gr...
The reason our own ocean is blue is because of the color of the sky. If your sky is red/orange, you might end up with a red ocean. You could also do what a couple others have said and try an alga that's red.
135,873
I have an idea that the seas of a world are red, not blue. However, the world should also be the birthplace of an intelligent alien species. Would it be scientifically possible to have a world with a red sea and where intelligent life can still develop?
2019/01/07
[ "https://worldbuilding.stackexchange.com/questions/135873", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/55800/" ]
***Your Ocean has a high hemoglobin content*** I would suggest using some sort of symbiotic system where said ocean thermally convects hemoglobin to the surface where it absorbs Oxygen from the atmosphere. This would create a bright red color. The convection along with the weight of the molecule could then cause it to...
The reason our own ocean is blue is because of the color of the sky. If your sky is red/orange, you might end up with a red ocean. You could also do what a couple others have said and try an alga that's red.
2,670
There are linguists that are very much against conlanging, here are two commonly claimed reasons: 1. It's not science. 2. It wastes manpower, time and energy that should have been used to rescue an already existing rare natural language or do field work. The latter reason is also common among non-linguists. What oth...
2012/10/06
[ "https://linguistics.stackexchange.com/questions/2670", "https://linguistics.stackexchange.com", "https://linguistics.stackexchange.com/users/119/" ]
Not sure about being “against”, but I’ve seen some linguists dismiss conlang studies due to a strong form of nativism. Suppose you’re convinced that 1) all languages are variations of an universal, hard-wired human capacity; 2) languages can only be acquired “for real” when you’re a child in the critical period; and 3)...
Creating a language is like writing a novel or creating a sculpture: it can be a fun exercise, and an object of art for people to admire. If you happen to not be into a certain genre, you will probably not be interested in studying it. I think the same thing applies to constructed languages. I personally do not find t...
2,670
There are linguists that are very much against conlanging, here are two commonly claimed reasons: 1. It's not science. 2. It wastes manpower, time and energy that should have been used to rescue an already existing rare natural language or do field work. The latter reason is also common among non-linguists. What oth...
2012/10/06
[ "https://linguistics.stackexchange.com/questions/2670", "https://linguistics.stackexchange.com", "https://linguistics.stackexchange.com/users/119/" ]
That this currently isn't a field with much revenue (except maybe movie languages) or practical use associated with it has already been mentioned. I think there is a throwing-out-the-baby-with-the-bath-water dynamic going on with the following triggers: 1. Crackpots. They exist in the conlang community and seem to be...
Creating a language is like writing a novel or creating a sculpture: it can be a fun exercise, and an object of art for people to admire. If you happen to not be into a certain genre, you will probably not be interested in studying it. I think the same thing applies to constructed languages. I personally do not find t...
2,670
There are linguists that are very much against conlanging, here are two commonly claimed reasons: 1. It's not science. 2. It wastes manpower, time and energy that should have been used to rescue an already existing rare natural language or do field work. The latter reason is also common among non-linguists. What oth...
2012/10/06
[ "https://linguistics.stackexchange.com/questions/2670", "https://linguistics.stackexchange.com", "https://linguistics.stackexchange.com/users/119/" ]
Though there are some linguists who express hostility toward conlanging, most notably Yaguello in her book "Lunatic Lovers of Language," I haven't heard of any general outcry from the linguistics community against conlanging. However, I do believe that most linguists consider natural language to be the proper subject m...
Creating a language is like writing a novel or creating a sculpture: it can be a fun exercise, and an object of art for people to admire. If you happen to not be into a certain genre, you will probably not be interested in studying it. I think the same thing applies to constructed languages. I personally do not find t...
2,670
There are linguists that are very much against conlanging, here are two commonly claimed reasons: 1. It's not science. 2. It wastes manpower, time and energy that should have been used to rescue an already existing rare natural language or do field work. The latter reason is also common among non-linguists. What oth...
2012/10/06
[ "https://linguistics.stackexchange.com/questions/2670", "https://linguistics.stackexchange.com", "https://linguistics.stackexchange.com/users/119/" ]
Not sure about being “against”, but I’ve seen some linguists dismiss conlang studies due to a strong form of nativism. Suppose you’re convinced that 1) all languages are variations of an universal, hard-wired human capacity; 2) languages can only be acquired “for real” when you’re a child in the critical period; and 3)...
Though there are some linguists who express hostility toward conlanging, most notably Yaguello in her book "Lunatic Lovers of Language," I haven't heard of any general outcry from the linguistics community against conlanging. However, I do believe that most linguists consider natural language to be the proper subject m...
2,670
There are linguists that are very much against conlanging, here are two commonly claimed reasons: 1. It's not science. 2. It wastes manpower, time and energy that should have been used to rescue an already existing rare natural language or do field work. The latter reason is also common among non-linguists. What oth...
2012/10/06
[ "https://linguistics.stackexchange.com/questions/2670", "https://linguistics.stackexchange.com", "https://linguistics.stackexchange.com/users/119/" ]
That this currently isn't a field with much revenue (except maybe movie languages) or practical use associated with it has already been mentioned. I think there is a throwing-out-the-baby-with-the-bath-water dynamic going on with the following triggers: 1. Crackpots. They exist in the conlang community and seem to be...
Though there are some linguists who express hostility toward conlanging, most notably Yaguello in her book "Lunatic Lovers of Language," I haven't heard of any general outcry from the linguistics community against conlanging. However, I do believe that most linguists consider natural language to be the proper subject m...
151,351
[Spartan 6 clocking resources.](http://www.xilinx.com/support/documentation/user_guides/ug382.pdf) The link here refers to the clocking resources of spartan-6 FPGA. I am using the DCM-CLKGEN primitive described in the link, to generate a 8x clock based on an input clock. It works fine as long as the input clock is stab...
2015/01/28
[ "https://electronics.stackexchange.com/questions/151351", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/65403/" ]
I suggest that you talk to another professor. I'm assuming you use an H-bridge motor controller to actually drive the motor. Without actually trying to implement it (that is, it may not work), I'd suggest that the controller has an enable input which will disable its internal drive. If you disable the controller just ...
Here's a short answer which could be improved upon if we knew more about the currents and voltages you're working with. Data sheets, links, etc., to the motor and batteries would help. :![enter image description here](https://i.stack.imgur.com/Ih4b7.png)
13,137,992
I am Using facebook C# SDK to connect to facebook from my mvc3 application. I am able to login but not able to logout. I used bellow code for logout ``` var oauth = new FacebookClient(); var logoutParameters = new Dictionary<string, object> { { "next", "http://localhost:8691" }...
2012/10/30
[ "https://Stackoverflow.com/questions/13137992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1498159/" ]
From the [docs](http://dev.mysql.com/doc/refman/5.5/en//connector-net-visual-studio-making-a-connection.html) > > You can also set the port to connect with the MySQL server by pressing > the Advanced button. > > >
Open Advanced settings by clicking "Advance" button and inside you'll find the port parameter and then change it, I've practiced it many times.
13,137,992
I am Using facebook C# SDK to connect to facebook from my mvc3 application. I am able to login but not able to logout. I used bellow code for logout ``` var oauth = new FacebookClient(); var logoutParameters = new Dictionary<string, object> { { "next", "http://localhost:8691" }...
2012/10/30
[ "https://Stackoverflow.com/questions/13137992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1498159/" ]
From the [docs](http://dev.mysql.com/doc/refman/5.5/en//connector-net-visual-studio-making-a-connection.html) > > You can also set the port to connect with the MySQL server by pressing > the Advanced button. > > >
After the ip just add ":portnumber" on the connection string
53,666,759
I'm doing a binary classification with CNNs and the data is imbalanced where the positive medical image : negative medical image = 0.4 : 0.6. So I want to use SMOTE to oversample the positive medical image data before training. However, the dimension of the data is 4D (761,64,64,3) which cause the error ``` Found arr...
2018/12/07
[ "https://Stackoverflow.com/questions/53666759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7918089/" ]
I had a similar issue. I had used the reshape function to reshape the image (basically flattened the image) ``` X_train.shape (8000, 250, 250, 3) ReX_train = X_train.reshape(8000, 250 * 250 * 3) ReX_train.shape (8000, 187500) smt = SMOTE() Xs_train, ys_train = smt.fit_sample(ReX_train, y_train) ``` Although, this ...
1. As soon as you flatten an image you are loosing localized information, this is one of the reasons why convolutions are used in image-based machine learning. 2. 8000x250x250x3 has an inherent meaning - 8000 samples of images, each image of width 250, height 250 and all of them have 3 channels when you do 8000x250\*25...
53,666,759
I'm doing a binary classification with CNNs and the data is imbalanced where the positive medical image : negative medical image = 0.4 : 0.6. So I want to use SMOTE to oversample the positive medical image data before training. However, the dimension of the data is 4D (761,64,64,3) which cause the error ``` Found arr...
2018/12/07
[ "https://Stackoverflow.com/questions/53666759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7918089/" ]
I had a similar issue. I had used the reshape function to reshape the image (basically flattened the image) ``` X_train.shape (8000, 250, 250, 3) ReX_train = X_train.reshape(8000, 250 * 250 * 3) ReX_train.shape (8000, 187500) smt = SMOTE() Xs_train, ys_train = smt.fit_sample(ReX_train, y_train) ``` Although, this ...
* First Flatten the image * Apply SMOTE on this flattened image data and its labels * Reshape the flattened image to RGB image ```py from imblearn.over_sampling import SMOTE sm = SMOTE(random_state=42) train_rows=len(X_train) X_train = X_train.reshape(train_rows,-1) (80,30000) X_train, y_train = sm.fit_resample(X_t...
53,666,759
I'm doing a binary classification with CNNs and the data is imbalanced where the positive medical image : negative medical image = 0.4 : 0.6. So I want to use SMOTE to oversample the positive medical image data before training. However, the dimension of the data is 4D (761,64,64,3) which cause the error ``` Found arr...
2018/12/07
[ "https://Stackoverflow.com/questions/53666759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7918089/" ]
1. As soon as you flatten an image you are loosing localized information, this is one of the reasons why convolutions are used in image-based machine learning. 2. 8000x250x250x3 has an inherent meaning - 8000 samples of images, each image of width 250, height 250 and all of them have 3 channels when you do 8000x250\*25...
* First Flatten the image * Apply SMOTE on this flattened image data and its labels * Reshape the flattened image to RGB image ```py from imblearn.over_sampling import SMOTE sm = SMOTE(random_state=42) train_rows=len(X_train) X_train = X_train.reshape(train_rows,-1) (80,30000) X_train, y_train = sm.fit_resample(X_t...
69,903,146
I need wait for two requests (observables) and do some things. What i need: 1. Wait for requests (observables) end 2. If one of them failed - display one error 3. If both of them failed - display second error 4. If first success - do some things 5. If second success - do some things i can combine 4 and 5 if that matt...
2021/11/09
[ "https://Stackoverflow.com/questions/69903146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9703442/" ]
catch your errors at the request level and transform them into something usable: ``` const firstRequest$ = this.doFirstRequest(searchRequest).pipe( catchError(error => of({error})) ); const secondRequest$ = this.doSecondRequest(searchRequest).pipe( catchError(error => of({error})) ); forkJoin([firstRequest$, seco...
1. You need to use `forkJoin` for this use case, See [ForkJoin docs](https://www.learnrxjs.io/learn-rxjs/operators/combination/forkjoin). 2. Add `catchError` operator to the first stream to handle the first request 3. Add another `catchError` operator to the second stream to handle it 4. Add `tap` operator to the first...
69,903,146
I need wait for two requests (observables) and do some things. What i need: 1. Wait for requests (observables) end 2. If one of them failed - display one error 3. If both of them failed - display second error 4. If first success - do some things 5. If second success - do some things i can combine 4 and 5 if that matt...
2021/11/09
[ "https://Stackoverflow.com/questions/69903146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9703442/" ]
catch your errors at the request level and transform them into something usable: ``` const firstRequest$ = this.doFirstRequest(searchRequest).pipe( catchError(error => of({error})) ); const secondRequest$ = this.doSecondRequest(searchRequest).pipe( catchError(error => of({error})) ); forkJoin([firstRequest$, seco...
I had a case where one request normally takes much longer than the other, so in the success case I don't want to have to wait for both requests to finish before continuing. As soon as one request finishes, I want to show the received data to the user. But the error handling needed to be different if both requests faile...
157,066
1. Because of his experience making his own films, he was hired as a script supervisor by Cathay Studios. **Soon afterwards**, Woo was able to start directing. 2. Because of his experience making his own films, he was hired as a script supervisor by Cathay Studios. **Soon**, Woo was able to start directing. 3. Becau...
2018/02/19
[ "https://ell.stackexchange.com/questions/157066", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
The first one is more correct. When in doubt, try to split the sentences into parts: > > At what time does [the next plane to London] leave? > > > The subject in this sentence is "the next plane to London" - which is a perfectly correct way to distinguish it from both "the next plane to Madrid" or "the last plane...
I agree with @maciej-stachowski that the first version is better, and I agree with their analysis of that version's syntax. *the next plane to London* is what you're asking about, and it's the plane that is flying to London soonest from your location. I also think that answer makes a good point that *the next plane* b...
2,731,075
This is my first time here, I hope that this is clear. So i will have code similar to this this. ``` <span class="mediaSource ui-draggable" id="purchsePlay7915504"> <a href="" onclick="return popup_window(this, 'MediaView', 850, 680)" class="control" enter code hereid="GenericLink"></a> <img id="Any_71" alt...
2010/04/28
[ "https://Stackoverflow.com/questions/2731075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/328063/" ]
Try $('span > a[onclick\*="popup\_window"]');
`:contains` applies only to text within a specific element. If the text "popup\_window" is not literally spelled out within the node `span`, it's not going to apply. I also noticed that your `if` check checks the general `span`, instead of the local `span`. The difference is that when you click `span.mediaSource`, the...
2,731,075
This is my first time here, I hope that this is clear. So i will have code similar to this this. ``` <span class="mediaSource ui-draggable" id="purchsePlay7915504"> <a href="" onclick="return popup_window(this, 'MediaView', 850, 680)" class="control" enter code hereid="GenericLink"></a> <img id="Any_71" alt...
2010/04/28
[ "https://Stackoverflow.com/questions/2731075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/328063/" ]
`:contains` applies only to text within a specific element. If the text "popup\_window" is not literally spelled out within the node `span`, it's not going to apply. I also noticed that your `if` check checks the general `span`, instead of the local `span`. The difference is that when you click `span.mediaSource`, the...
First select the a tag correctly, then in the click look at the attribute's value. ``` $(document).ready(function() { $('span.mediaSource a.control').click(function(e) { if ($(this).attr('onclick').indexOf('popup_window') { //Do Stuff } e.preventDefault(); //Cancel the click action }); }); `...
2,731,075
This is my first time here, I hope that this is clear. So i will have code similar to this this. ``` <span class="mediaSource ui-draggable" id="purchsePlay7915504"> <a href="" onclick="return popup_window(this, 'MediaView', 850, 680)" class="control" enter code hereid="GenericLink"></a> <img id="Any_71" alt...
2010/04/28
[ "https://Stackoverflow.com/questions/2731075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/328063/" ]
Try $('span > a[onclick\*="popup\_window"]');
First select the a tag correctly, then in the click look at the attribute's value. ``` $(document).ready(function() { $('span.mediaSource a.control').click(function(e) { if ($(this).attr('onclick').indexOf('popup_window') { //Do Stuff } e.preventDefault(); //Cancel the click action }); }); `...
552,952
I have encountered the following problem in one of my textbooks but I'm not really getting anywhere: Let $f$ be complex-valued and piecewise continuous on the interval $[-\pi,\pi]$. Find the complex fourier series of $Re(f)$ on the basis of the complex Fourier series of $f$. i.e we're given that $f$ has the complex F...
2013/11/05
[ "https://math.stackexchange.com/questions/552952", "https://math.stackexchange.com", "https://math.stackexchange.com/users/100970/" ]
The Newton iteration is $$ x\_{n+1} = x\_n - \frac{f(x\_n)}{f'(x\_n)} $$ and to find the inverse you should root-find $f(x) = 1/x - R$ which has a root at $1/R$. Note that $f'(x) = -1/x^2$ so $f(x\_n)/f'(x\_n)$ will give you exactly the iteration you are looking for.
The function $f(x) = R - \frac{1}{x}. \;$ You find the simple derivation of your recursion formula [here](http://en.wikipedia.org/wiki/Newton%27s_method#Multiplicative_inverse_of_numbers_and_power_series)
7,312,730
I'm trying to grasp the best approach to saving (serializing) and restoring (deserializing) a DOM selection or range. There is a post here on stringifying a range object, but it frankly doesn't really work. The situation is an interactive text book using the Webkit view of Adobe Air. I have static (built-in) html cont...
2011/09/05
[ "https://Stackoverflow.com/questions/7312730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/464792/" ]
I would create a new dict containing two items: the inventory dict and the quantity. I'd add an item to itemsArray like this (untested, so beware of typos): ``` BOOL found = NO; for (NSDictionary *dict in itemsArray) { if ([[dict objectForKey: @"inventorydict"] isEqual: inventory.itemDict]) { [dict set...
FYI for `setObject:` you do not need to use `stringWithFormat:` if you do not have an object to add to it, you can simply use `setObject:@"1"`. If you want to increment the **Quantity**, you should be using `setObject:[NSNumber numberWithInt:1]` instead.
7,312,730
I'm trying to grasp the best approach to saving (serializing) and restoring (deserializing) a DOM selection or range. There is a post here on stringifying a range object, but it frankly doesn't really work. The situation is an interactive text book using the Webkit view of Adobe Air. I have static (built-in) html cont...
2011/09/05
[ "https://Stackoverflow.com/questions/7312730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/464792/" ]
Store your dictionaries in an `NSCountedSet`. You can then get the quantity via `-countForObject:`. Use an array only for presentation purposes, so you can sort the values in a sane way. Rebuild this array whenever the set changes, something like so: ``` - (void)itemsDidChange { NSCountedSet *itemSet = [self itemS...
FYI for `setObject:` you do not need to use `stringWithFormat:` if you do not have an object to add to it, you can simply use `setObject:@"1"`. If you want to increment the **Quantity**, you should be using `setObject:[NSNumber numberWithInt:1]` instead.
7,312,730
I'm trying to grasp the best approach to saving (serializing) and restoring (deserializing) a DOM selection or range. There is a post here on stringifying a range object, but it frankly doesn't really work. The situation is an interactive text book using the Webkit view of Adobe Air. I have static (built-in) html cont...
2011/09/05
[ "https://Stackoverflow.com/questions/7312730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/464792/" ]
I would create a new dict containing two items: the inventory dict and the quantity. I'd add an item to itemsArray like this (untested, so beware of typos): ``` BOOL found = NO; for (NSDictionary *dict in itemsArray) { if ([[dict objectForKey: @"inventorydict"] isEqual: inventory.itemDict]) { [dict set...
Store your dictionaries in an `NSCountedSet`. You can then get the quantity via `-countForObject:`. Use an array only for presentation purposes, so you can sort the values in a sane way. Rebuild this array whenever the set changes, something like so: ``` - (void)itemsDidChange { NSCountedSet *itemSet = [self itemS...
7,312,730
I'm trying to grasp the best approach to saving (serializing) and restoring (deserializing) a DOM selection or range. There is a post here on stringifying a range object, but it frankly doesn't really work. The situation is an interactive text book using the Webkit view of Adobe Air. I have static (built-in) html cont...
2011/09/05
[ "https://Stackoverflow.com/questions/7312730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/464792/" ]
I would create a new dict containing two items: the inventory dict and the quantity. I'd add an item to itemsArray like this (untested, so beware of typos): ``` BOOL found = NO; for (NSDictionary *dict in itemsArray) { if ([[dict objectForKey: @"inventorydict"] isEqual: inventory.itemDict]) { [dict set...
based on Rudy's post made it working this way: ``` -(void)addToCart:(id)sender { appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; BOOL found = NO; NSString *itemName = // get your item name here [theDict setObject:itemName forKey:@"name"]; if ([appDelegate.theCar...
7,312,730
I'm trying to grasp the best approach to saving (serializing) and restoring (deserializing) a DOM selection or range. There is a post here on stringifying a range object, but it frankly doesn't really work. The situation is an interactive text book using the Webkit view of Adobe Air. I have static (built-in) html cont...
2011/09/05
[ "https://Stackoverflow.com/questions/7312730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/464792/" ]
Store your dictionaries in an `NSCountedSet`. You can then get the quantity via `-countForObject:`. Use an array only for presentation purposes, so you can sort the values in a sane way. Rebuild this array whenever the set changes, something like so: ``` - (void)itemsDidChange { NSCountedSet *itemSet = [self itemS...
based on Rudy's post made it working this way: ``` -(void)addToCart:(id)sender { appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; BOOL found = NO; NSString *itemName = // get your item name here [theDict setObject:itemName forKey:@"name"]; if ([appDelegate.theCar...
8,749,543
I have a program that wants to check if a file has been modified. The regtest fails, and, indeed, despite the file having changed, the `st_mtime` has not! Moreover, an external stat confirms the same. I believe st\_mtime *should* change because stat(2) says > > The field st\_mtime is changed by file modifications, f...
2012/01/05
[ "https://Stackoverflow.com/questions/8749543", "https://Stackoverflow.com", "https://Stackoverflow.com/users/833300/" ]
First off, I'd strongly encourage you to not use statements with side effects within `assert`s. I understand it's convenient and if the code is never going to go production it doesn't really matter, but it's not good form. In particular, if you ever define `NDEBUG`, the `assert`s get converted to a noop, the code for t...
**Never use `assert`** on functions with side effects! Always do this: ``` FILE * fp; fp = fopen(...); assert(fp != NULL); ``` The entire line containing the `assert()` disappears from release builds.
8,961,133
I got the following warning: > > Optimize background properties > > > This inspection tries to find similar CSS properties, which can be transformed to shorter form (shorthand; padding for individual sides can be shortened to 'padding' shorthand if possible, etc). > > > on this line of CSS: ``` background: url...
2012/01/22
[ "https://Stackoverflow.com/questions/8961133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/245552/" ]
Inspection is not triggered for just this line, can you provide a complete example? Maybe there is another `background` attribute in your style that can be merged into this one? Normally you press `Alt`+`Enter`, `Enter` to activate the inspection and see the results after applying it. If it's not what you want, just Un...
``` background: transparent; background-image:url("resimler/search.png"); //on line ``` Optimize background properties less... (Ctrl+F1) Inspection info: This inspection tries to find similar CSS properties, which can be transformed to shorter form (shorthand; padding for individual sides can be shortened to 'padd...
63,009
My mom wants to do baking but her oven doesn't have bottom heating element. It only has an element on top, with a fan at the back. She told me that she can't make me a good pizza or cake without it. Is there any way around?
2015/10/31
[ "https://cooking.stackexchange.com/questions/63009", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/40437/" ]
Many modern ovens seem to have unusual element configurations, but with a fan it makes no difference, just use as the oven manual indicates Cooking a pizza in any domestic electric oven is tricky, as it requires more heat than an electric oven can generate. Using a metal or stone slab helps
For things that can be baked for a short period of time, you can partially compensate by adding a baking stone in the bottom of the oven, then sufficiently preheating the oven. The stone will release its heat, resulting in there being some additional heat coming from the bottom of the oven. For pizzas, you can move t...
63,009
My mom wants to do baking but her oven doesn't have bottom heating element. It only has an element on top, with a fan at the back. She told me that she can't make me a good pizza or cake without it. Is there any way around?
2015/10/31
[ "https://cooking.stackexchange.com/questions/63009", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/40437/" ]
For things that can be baked for a short period of time, you can partially compensate by adding a baking stone in the bottom of the oven, then sufficiently preheating the oven. The stone will release its heat, resulting in there being some additional heat coming from the bottom of the oven. For pizzas, you can move t...
I know using a cast iron skillet starting off your pizzas on the bottom rack depending on the thickness of the crust for 15 to 25 minutes and raising it to the second to the top for the last 7 to 12 minutes and the cast iron skillet will continue cooking once you shut the oven off to make it nice and crispy... I will a...
63,009
My mom wants to do baking but her oven doesn't have bottom heating element. It only has an element on top, with a fan at the back. She told me that she can't make me a good pizza or cake without it. Is there any way around?
2015/10/31
[ "https://cooking.stackexchange.com/questions/63009", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/40437/" ]
Many modern ovens seem to have unusual element configurations, but with a fan it makes no difference, just use as the oven manual indicates Cooking a pizza in any domestic electric oven is tricky, as it requires more heat than an electric oven can generate. Using a metal or stone slab helps
I have a similar type of oven. For basic baking (cake/brownies), I started turning the temp on the oven down about 20 degrees and baking the items for the max time. That seems to be helping. HOWEVER, I am still struggling with pizza and pies (thus searching the internet, and stumbling onto this thread). I might try...
63,009
My mom wants to do baking but her oven doesn't have bottom heating element. It only has an element on top, with a fan at the back. She told me that she can't make me a good pizza or cake without it. Is there any way around?
2015/10/31
[ "https://cooking.stackexchange.com/questions/63009", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/40437/" ]
I have a similar type of oven. For basic baking (cake/brownies), I started turning the temp on the oven down about 20 degrees and baking the items for the max time. That seems to be helping. HOWEVER, I am still struggling with pizza and pies (thus searching the internet, and stumbling onto this thread). I might try...
I know using a cast iron skillet starting off your pizzas on the bottom rack depending on the thickness of the crust for 15 to 25 minutes and raising it to the second to the top for the last 7 to 12 minutes and the cast iron skillet will continue cooking once you shut the oven off to make it nice and crispy... I will a...
63,009
My mom wants to do baking but her oven doesn't have bottom heating element. It only has an element on top, with a fan at the back. She told me that she can't make me a good pizza or cake without it. Is there any way around?
2015/10/31
[ "https://cooking.stackexchange.com/questions/63009", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/40437/" ]
Many modern ovens seem to have unusual element configurations, but with a fan it makes no difference, just use as the oven manual indicates Cooking a pizza in any domestic electric oven is tricky, as it requires more heat than an electric oven can generate. Using a metal or stone slab helps
I know using a cast iron skillet starting off your pizzas on the bottom rack depending on the thickness of the crust for 15 to 25 minutes and raising it to the second to the top for the last 7 to 12 minutes and the cast iron skillet will continue cooking once you shut the oven off to make it nice and crispy... I will a...
344,510
[![enter image description here](https://i.stack.imgur.com/CUnSG.jpg)](https://i.stack.imgur.com/CUnSG.jpg) According to my analysis, none of the options are correct. But the answer mentioned in my workbook is option B. [![enter image description here](https://i.stack.imgur.com/evnkb.png)](https://i.stack.imgur.com/e...
2017/12/11
[ "https://electronics.stackexchange.com/questions/344510", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/-1/" ]
1. Yes, the Zener breaks down because of the 10V offset. The sine wave is to allow you to measure the impedance of the Zener model at the test current. 2. From the datasheet you can usually find information that will help. Zx (dynamic impedance), for example, but it has to be specified at or near the operating current....
Any voltage above 6.2V will cause the Zener to break down. Peak current will simply be (11.4 - 6.2)/100 = 52 mA
344,510
[![enter image description here](https://i.stack.imgur.com/CUnSG.jpg)](https://i.stack.imgur.com/CUnSG.jpg) According to my analysis, none of the options are correct. But the answer mentioned in my workbook is option B. [![enter image description here](https://i.stack.imgur.com/evnkb.png)](https://i.stack.imgur.com/e...
2017/12/11
[ "https://electronics.stackexchange.com/questions/344510", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/-1/" ]
Any voltage above 6.2V will cause the Zener to break down. Peak current will simply be (11.4 - 6.2)/100 = 52 mA
Actually your voltage regulator works. 2,8Vpp input variation causes only 6mVpp variation in output. Not bad for a circuit this simple. This regulator principle is not good, if you want to use the regulated voltage to supply some load which takes plenty of current and that current is not constant, but varies widely. ...
344,510
[![enter image description here](https://i.stack.imgur.com/CUnSG.jpg)](https://i.stack.imgur.com/CUnSG.jpg) According to my analysis, none of the options are correct. But the answer mentioned in my workbook is option B. [![enter image description here](https://i.stack.imgur.com/evnkb.png)](https://i.stack.imgur.com/e...
2017/12/11
[ "https://electronics.stackexchange.com/questions/344510", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/-1/" ]
1. Yes, the Zener breaks down because of the 10V offset. The sine wave is to allow you to measure the impedance of the Zener model at the test current. 2. From the datasheet you can usually find information that will help. Zx (dynamic impedance), for example, but it has to be specified at or near the operating current....
Actually your voltage regulator works. 2,8Vpp input variation causes only 6mVpp variation in output. Not bad for a circuit this simple. This regulator principle is not good, if you want to use the regulated voltage to supply some load which takes plenty of current and that current is not constant, but varies widely. ...
53,959,911
I have a question about angular loops. I would like to delay the rendering process on a ng-for. For example, ``` <div *ngFor="let data of items | delay"> <app-my-component [data]="data"></app-my-component> </div> ``` Delay 10ms for each render. The "items" array comes from another component that I can't change it....
2018/12/28
[ "https://Stackoverflow.com/questions/53959911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2107255/" ]
Actually this is interesting question and couldn't found exact question on the SO. **This is my solution**, I wrote helper methods for easier understanding and future code reuse: **My solution** on [Live StackBlitz editor Link](https://stackblitz.com/edit/angular-6-delay-the-loop) ``` import { from, timer, Observabl...
You can make use of async pipe to load an observable ``` //define your delay observable this.delayItems=of(items).pipe(delay(1000)) ``` in your template ``` <div *ngFor="let data of delayItems | async"> <app-my-component [data]="data"></app-my-component> </div> ``` > > Update > > > ``` import { Component ...
5,058,634
I need some help with a formatting function. I need to be able to take the input (function argument) and format the string to something else. Here's my options: ``` 7am7pm 10am10pm OFF ``` So, depending on what is selected, I want the regex to meet the following output criteria: ``` 7am-7pm 10am-10pm OFF ``` In o...
2011/02/20
[ "https://Stackoverflow.com/questions/5058634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259717/" ]
Try ``` preg_replace("/(\d{1,2}(am|pm))(\d{1,2}(am|pm))/", "$1-$3", $string); ``` Demo: <http://codepad.org/BBwW4eEE>
This should handle the times for you (and you'd manage "OFF" with a simple if statement): ``` $output = preg_replace('/^([0-9]{1,2}(am|pm))-?([0-9]{1,2}(am|pm))$/i', '$1-$3', $input); ```
5,058,634
I need some help with a formatting function. I need to be able to take the input (function argument) and format the string to something else. Here's my options: ``` 7am7pm 10am10pm OFF ``` So, depending on what is selected, I want the regex to meet the following output criteria: ``` 7am-7pm 10am-10pm OFF ``` In o...
2011/02/20
[ "https://Stackoverflow.com/questions/5058634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259717/" ]
Try ``` preg_replace("/(\d{1,2}(am|pm))(\d{1,2}(am|pm))/", "$1-$3", $string); ``` Demo: <http://codepad.org/BBwW4eEE>
Here's a version using [assertions](http://www.regular-expressions.info/lookaround.html), so it only has to inject one character: ``` return preg_replace('/(?<=[a-z])(?=\d)/', "-", $arg); ``` It looks only for the position in the string where a letter `?<=` precedes and a number `?=` follows.
5,058,634
I need some help with a formatting function. I need to be able to take the input (function argument) and format the string to something else. Here's my options: ``` 7am7pm 10am10pm OFF ``` So, depending on what is selected, I want the regex to meet the following output criteria: ``` 7am-7pm 10am-10pm OFF ``` In o...
2011/02/20
[ "https://Stackoverflow.com/questions/5058634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259717/" ]
Try ``` preg_replace("/(\d{1,2}(am|pm))(\d{1,2}(am|pm))/", "$1-$3", $string); ``` Demo: <http://codepad.org/BBwW4eEE>
How about this: ``` function format_date($date) { if( $date == 'off' ) return 'off'; return preg_replace( '/^(\d{1,2}\w{2})(\d{1,2}\w{2})$/' , '${1}-${2}' , $date ); } ``` I'm presuming you're saying the input will look like the first box, and should be formatted like the second?
5,058,634
I need some help with a formatting function. I need to be able to take the input (function argument) and format the string to something else. Here's my options: ``` 7am7pm 10am10pm OFF ``` So, depending on what is selected, I want the regex to meet the following output criteria: ``` 7am-7pm 10am-10pm OFF ``` In o...
2011/02/20
[ "https://Stackoverflow.com/questions/5058634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259717/" ]
Here's a version using [assertions](http://www.regular-expressions.info/lookaround.html), so it only has to inject one character: ``` return preg_replace('/(?<=[a-z])(?=\d)/', "-", $arg); ``` It looks only for the position in the string where a letter `?<=` precedes and a number `?=` follows.
This should handle the times for you (and you'd manage "OFF" with a simple if statement): ``` $output = preg_replace('/^([0-9]{1,2}(am|pm))-?([0-9]{1,2}(am|pm))$/i', '$1-$3', $input); ```
5,058,634
I need some help with a formatting function. I need to be able to take the input (function argument) and format the string to something else. Here's my options: ``` 7am7pm 10am10pm OFF ``` So, depending on what is selected, I want the regex to meet the following output criteria: ``` 7am-7pm 10am-10pm OFF ``` In o...
2011/02/20
[ "https://Stackoverflow.com/questions/5058634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259717/" ]
This should handle the times for you (and you'd manage "OFF" with a simple if statement): ``` $output = preg_replace('/^([0-9]{1,2}(am|pm))-?([0-9]{1,2}(am|pm))$/i', '$1-$3', $input); ```
How about this: ``` function format_date($date) { if( $date == 'off' ) return 'off'; return preg_replace( '/^(\d{1,2}\w{2})(\d{1,2}\w{2})$/' , '${1}-${2}' , $date ); } ``` I'm presuming you're saying the input will look like the first box, and should be formatted like the second?
5,058,634
I need some help with a formatting function. I need to be able to take the input (function argument) and format the string to something else. Here's my options: ``` 7am7pm 10am10pm OFF ``` So, depending on what is selected, I want the regex to meet the following output criteria: ``` 7am-7pm 10am-10pm OFF ``` In o...
2011/02/20
[ "https://Stackoverflow.com/questions/5058634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259717/" ]
Here's a version using [assertions](http://www.regular-expressions.info/lookaround.html), so it only has to inject one character: ``` return preg_replace('/(?<=[a-z])(?=\d)/', "-", $arg); ``` It looks only for the position in the string where a letter `?<=` precedes and a number `?=` follows.
How about this: ``` function format_date($date) { if( $date == 'off' ) return 'off'; return preg_replace( '/^(\d{1,2}\w{2})(\d{1,2}\w{2})$/' , '${1}-${2}' , $date ); } ``` I'm presuming you're saying the input will look like the first box, and should be formatted like the second?
314,576
I've started with thinking that if X and Y are perfectly correlated, then it is the same as looking at the correlation of Y and -Y (since the X provides no new information) and thus the correlation is -1. Is this correct?
2017/11/19
[ "https://stats.stackexchange.com/questions/314576", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/165916/" ]
Hint: *In general*, \begin{align} \rho\_{A,B} &= \frac{\operatorname{cov}(A,B)}{\sqrt{\operatorname{var}(A)\operatorname{var}(B)}},\\ \operatorname{var}(X\pm Y)&= \operatorname{var}(X)+\operatorname{var}(Y) \pm 2\operatorname{cov}(X,Y),\\ \text{and}\qquad\operatorname{cov}(X+Y,X-Y)&=\operatorname{var}(X)-\operatorname{...
I'll treat this as [self-study](/questions/tagged/self-study "show questions tagged 'self-study'"), and I'd encourage you to read [its wiki](https://stats.stackexchange.com/tags/self-study/info) and add the tag. Your argument is already very good. Here are a few pointers. Feel free to write a comment so we can discuss...
314,576
I've started with thinking that if X and Y are perfectly correlated, then it is the same as looking at the correlation of Y and -Y (since the X provides no new information) and thus the correlation is -1. Is this correct?
2017/11/19
[ "https://stats.stackexchange.com/questions/314576", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/165916/" ]
I'll treat this as [self-study](/questions/tagged/self-study "show questions tagged 'self-study'"), and I'd encourage you to read [its wiki](https://stats.stackexchange.com/tags/self-study/info) and add the tag. Your argument is already very good. Here are a few pointers. Feel free to write a comment so we can discuss...
I see this already has an accepted answer, but I've always liked simulations more than equations, and this seemed like a fun question. I generated a variable $x$ from a distribution $N(0, 1)$ whose sample size $n$ was drawn from $U(100, 10000)$. To make $y$, I simply added a constant—drawn from $U(1, 100)$—to $x$. I th...
314,576
I've started with thinking that if X and Y are perfectly correlated, then it is the same as looking at the correlation of Y and -Y (since the X provides no new information) and thus the correlation is -1. Is this correct?
2017/11/19
[ "https://stats.stackexchange.com/questions/314576", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/165916/" ]
I'll treat this as [self-study](/questions/tagged/self-study "show questions tagged 'self-study'"), and I'd encourage you to read [its wiki](https://stats.stackexchange.com/tags/self-study/info) and add the tag. Your argument is already very good. Here are a few pointers. Feel free to write a comment so we can discuss...
$X,Y$ perfectly correlate $\implies Cov(X,Y)=\sqrt{Var(X)Var(Y)}$ $Cov(X+Y,X-Y)=Cov(X,X)-Cov(X,Y)+Cov(Y,X)-Cov(Y,Y)=Var(X)-Var(Y)$ $Var(X+Y)Var(X-Y)=[Var(X)+Var(Y)+2Cov(X,Y)][Var(X)+Var(Y)-2Cov(X,Y)]=[Var(X)+Var(Y)]^2-4Cov(X,Y)Cov(X,Y)=\_{\rho\_{X,Y}=1}=[Var(X)+Var(Y)]^2-4Var(X)Var(Y)=[Var(X)-Var(Y)]^2$ Hence, $\rho...